|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
dlife.robot.Device
dlife.robot.OnOffSetEffector
dlife.robot.scribbler.ScribblerLEDs
public class ScribblerLEDs
A class for controlling the programmable LEDs on the Scribbler and the Fluke. In practice only the left and right LEDs on the Scribbler are programmable. The Scribbler OS blinks the center LED and thus, while its state can be programmed it is quickly lost due to the blinking. The front LED on the Fluke is an on/off led. The back LED on the Fluke can have its brightness adjusted.
The Scribbler's LED are at the rear of the Scribbler in the default orientation (Scribbler.FLUKE_AT_REAR). If the robot's orientation is changed to Scribbler.FLUKE_AT_FRONT then the LED's are near the rear of the robot. The left-to-right ordering of the LEDs is presented with respect to the robot's current orientation.
This class assumes that the Fluke camera always faces the front of the robot. Thus, in FLUKE_AT_REAR mode the reversing dongle is used. When this is done the front, back positions of the LEDs remain the same with respect to the orientation of the robot. If your Fluke is not mounted in the above manner then you will need to compensate for the reversed position of the Fluke when accessing the LEDs.
| Field Summary | |
|---|---|
static int |
CENTER
The index of the Scribbler's center LED. |
static int |
FRONT
The index of the Fluke's front LED. |
static int |
LEFT
The index of the Scribbler's left LED |
static int |
RIGHT
The index of the Scribbler's right LED. |
| Fields inherited from class dlife.robot.OnOffSetEffector |
|---|
effectorStates |
| Fields inherited from class dlife.robot.Device |
|---|
DEFAULT_GUI_UPDATE_DELAY, DEFAULT_READ_DELAY, myRobot, readCount |
| Constructor Summary | |
|---|---|
ScribblerLEDs()
Construct a new ScribblerLEDs object. |
|
| Method Summary | |
|---|---|
protected DeviceDisplay[] |
createGUIObjects()
Get the object that is the GUI for this Scribbler's LEDs. |
void |
freeze()
Does nothing. |
int |
getRearLEDPercent()
Get the current percent of maximum brightness setting of the Fluke's rear LED. |
boolean |
isCenterOn()
Determine if the center LED is on or off. |
boolean |
isFrontOn()
Determine if the Fluke's front LED is on or off. |
boolean |
isLeftOn()
Determine if the Scribbler's left LED is on or off. |
boolean |
isRightOn()
Determine if the Scribbler's right LED is on or off. |
void |
readStateFromRobot()
Does nothing. |
void |
setCenter(boolean turnOn)
Set the state of the Scribbler's center LED. |
void |
setFront(boolean turnOn)
Set the state of the Fluke's front LED. |
void |
setLeft(boolean turnOn)
Set the state of the Scribbler's left LED. |
void |
setRearLEDPercent(int value)
Set the brightness of the Fluke's rear LED. |
void |
setRight(boolean turnOn)
Set the state of the Scribbler's right LED. |
protected void |
setRobotEffectorPattern(String pattern)
Send a message to the Scribbler asking it to set its LEDs according to the specified pattern. |
void |
shutDown()
Turns off all of the LED's when the device is shut down. |
| Methods inherited from class dlife.robot.OnOffSetEffector |
|---|
getEffectorPattern, getNumEffectors, isEffectorOn, setEffector, setEffectorPattern, startUp |
| Methods inherited from class dlife.robot.Device |
|---|
getAutoRead, getGUI, getGUIUpdateDelay, getReadDelay, getRobot, getSensorReadCount, getSensorReadRate, setAutoRead, setGUIUpdateDelay, setReadDelay, setRobot, startAutoReadTimer, stopAutoReadTimer |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public static final int FRONT
| Constructor Detail |
|---|
public ScribblerLEDs()
| Method Detail |
|---|
public void shutDown()
shutDown in class OnOffSetEffectorpublic void freeze()
freeze in class Devicepublic void readStateFromRobot()
readStateFromRobot in class Devicepublic void setRearLEDPercent(int value)
value - the percent of maximum brightness of the LED. The value will
be bound to the range [0 ... 100] with 0 being off and 100
being the maximum brightness.public int getRearLEDPercent()
public void setLeft(boolean turnOn)
turnOn - true to turn the LED on, false to turn it off.public boolean isLeftOn()
public void setCenter(boolean turnOn)
turnOn - true to turn the light on, false to turn it off.public boolean isCenterOn()
public void setRight(boolean turnOn)
turnOn - true to turn the LED on, false to turn it off.public boolean isRightOn()
public void setFront(boolean turnOn)
turnOn - true to turn the LED on, false to turn it off.public boolean isFrontOn()
protected void setRobotEffectorPattern(String pattern)
setRobotEffectorPattern in class OnOffSetEffectorpattern - a String of 1's and 0's indicating the pattern of on's and
off's for the Scribbler's LEDs.
RobotCommunicationException - if unable to communicate with the
Scribbler.protected DeviceDisplay[] createGUIObjects()
createGUIObjects in class Device
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||