jBotBrain.hw
Class Led

java.lang.Object
  extended by jBotBrain.hw.Led

public class Led
extends Object

Onboard LED abstraction class. Usage:

 Led.GREEN1.set(Led.MODE_ON, 0);       // Turn on first green led
 Led.ORANGE.set(Led.MODE_BLINK, 400);  // Set orange led to blink with period 400 ms
 Led.setAll(false);                    // Turn off all leds
 

Author:
Martin Wolf

Field Summary
static Led GREEN1
          1st green led
static Led GREEN2
          2nd green led
static int MODE_BLINK
          Blink led
static int MODE_OFF
          Turn off led
static int MODE_ON
          Turn on led
static Led ORANGE
          Orange led
static Led RED
          Red led
 
Method Summary
static void ledSetAll(boolean on)
          Static method to sed all led on or off.
 void set(int mode, int time)
          Set led mode and time (if in blink mode)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Field Detail

MODE_OFF

public static final int MODE_OFF
Turn off led

See Also:
Constant Field Values

MODE_ON

public static final int MODE_ON
Turn on led

See Also:
Constant Field Values

MODE_BLINK

public static final int MODE_BLINK
Blink led

See Also:
Constant Field Values

GREEN1

public static final Led GREEN1
1st green led


GREEN2

public static final Led GREEN2
2nd green led


ORANGE

public static final Led ORANGE
Orange led


RED

public static final Led RED
Red led

Method Detail

set

public void set(int mode,
                int time)
Set led mode and time (if in blink mode)

Parameters:
mode - - Led mode
time - - Blinking period (if MODE_BLINK is selected)
See Also:
MODE_OFF, MODE_ON, MODE_BLINK

ledSetAll

public static void ledSetAll(boolean on)
Static method to sed all led on or off.

Parameters:
on - - if true all led are shining.