org.jraf.jlibibuddy
Class IBuddyUtils

java.lang.Object
  extended by org.jraf.jlibibuddy.IBuddyUtils

public class IBuddyUtils
extends java.lang.Object

Utility class providing high-level commands for the i-Buddy.


Method Summary
static void blink(IBuddy iBuddy, IBuddy.Color color, long onTime, long offTime, int times)
          Makes the i-Buddy's head blink.
static void flap(IBuddy iBuddy, long delay, int times)
          Makes the i-Buddy flap its wings (move up then down).
static void nudge(IBuddy iBuddy, long delay, int times)
          Makes the i-Buddy nudge (rotate left, then right).
static void sleep(long ms)
          Makes the current thread sleep a number of milliseconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

sleep

public static void sleep(long ms)
Makes the current thread sleep a number of milliseconds. This simply calls Thread.sleep(long) and ignores the InterruptedException if it is thrown.

Parameters:
ms - the number of milliseconds to sleep.

blink

public static void blink(IBuddy iBuddy,
                         IBuddy.Color color,
                         long onTime,
                         long offTime,
                         int times)
                  throws IBuddyException
Makes the i-Buddy's head blink.

Parameters:
iBuddy - the IBuddy object.
color - the color to use.
onTime - the duration in milliseconds to wait after turning the head on.
offTime - the duration in milliseconds to wait after turning the head off.
times - number of times to blink.
Throws:
IBuddyException - in case of problem while sending the usb command.

nudge

public static void nudge(IBuddy iBuddy,
                         long delay,
                         int times)
                  throws IBuddyException
Makes the i-Buddy nudge (rotate left, then right).

Parameters:
iBuddy - the IBuddy object.
delay - the delay in milliseconds to use between rotating left and right.
times - the number of times to nudge.
Throws:
IBuddyException - in case of problem while sending the usb command.

flap

public static void flap(IBuddy iBuddy,
                        long delay,
                        int times)
                 throws IBuddyException
Makes the i-Buddy flap its wings (move up then down).

Parameters:
iBuddy - the IBuddy object.
delay - the delay in milliseconds to use between moving the wings up and down.
times - the number of times to flap.
Throws:
IBuddyException - in case of problem while sending the usb command.


Copyright © 2008 JRAF.org. All Rights Reserved.