|
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.ArraySensor<Boolean>
dlife.robot.hemisson.HemissonLCD
public class HemissonLCD
A class for interacting with the HemissonLCD display.

The LCD can display 2 lines of text with up to 12 characters per line. The LCD also has 3 buttons that can be pressed. When setting text the top line refers to the rearmost line, the bottom line is the frontmost line and the buttons are labeled 0 through 2 going left to right.
| Field Summary | |
|---|---|
static int |
CENTER_ALIGNMENT
The integer representation of aligning the LCD text to the center. |
static int |
CENTER_BUTTON
The integer representation of the center button. |
static int |
LEFT_ALIGNMENT
The integer representation of aligning the LCD text to the left. |
static int |
LEFT_BUTTON
The integer representation of the left button. |
static int |
RIGHT_ALIGNMENT
The integer representation of aligning the LCD text to the right. |
static int |
RIGHT_BUTTON
The integer representation of the right button. |
| Fields inherited from class dlife.robot.ArraySensor |
|---|
length, values |
| Fields inherited from class dlife.robot.Device |
|---|
DEFAULT_GUI_UPDATE_DELAY, DEFAULT_READ_DELAY, myRobot, readCount |
| Constructor Summary | |
|---|---|
HemissonLCD()
Create a new HemissonLCD effector. |
|
| Method Summary | |
|---|---|
void |
clearAll()
Clear all text on the LCD screen. |
void |
clearBottomLine()
Clear all text on the bottom line of the LCD screen. |
void |
clearTopLine()
Clear all text on the top line of the LCD screen. |
protected DeviceDisplay[] |
createGUIObjects()
Get the object that is the GUI for this HemissonLCD display. |
void |
freeze()
Nothing needs to be done on freeze. |
int |
getBottomLineAlignment()
Get the current alignment of the bottom line. |
String |
getBottomLineText()
Get the current text of the bottom line. |
int |
getBrightness()
Get the current brightness value of the LCD. |
boolean |
getButtonValue(int button)
Get the value of the given button number. |
int |
getContrast()
Get the current contrast value of the LCD. |
int |
getTopLineAlignment()
Get the current alignment of the top line. |
String |
getTopLineText()
Get the current text of the top line. |
static void |
main(String[] args)
A test method that creates a Hemission and a HemissonLCD and displays the GUI so that the LCD can be tested. |
void |
readStateFromRobot()
Read the data from the buttons on the LCD display and update the values. |
void |
setBottomLineText(String text,
int alignment)
Set the bottom line of the LCD to the given line of text. |
void |
setBrightness(int brightness)
Set the brightness of the display to the given number. |
void |
setContrast(int contrast)
Set the contrast of the display to the given number. |
void |
setText(String text,
int alignment)
Set the text of the LCD screen to the given String. |
void |
setTopLineText(String text,
int alignment)
Set the top line of the LCD to the given line of text. |
void |
shutDown()
Clears the LCD screen, sets the brightness back to 0, and sets the contrast back to 210. |
void |
startUp()
Sets the initial brightness to 0, and sets the contrast to 210. |
| Methods inherited from class dlife.robot.ArraySensor |
|---|
getAverage, getAverage, getMaximum, getMaximum, getMaximumIndex, getMaximumIndex, getMinimum, getMinimum, getMinimumIndex, getMinimumIndex, getNumValues, getSubset, getValue, getValues |
| 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_ALIGNMENT
public static final int CENTER_ALIGNMENT
public static final int RIGHT_ALIGNMENT
public static final int LEFT_BUTTON
public static final int CENTER_BUTTON
public static final int RIGHT_BUTTON
| Constructor Detail |
|---|
public HemissonLCD()
| Method Detail |
|---|
public void startUp()
startUp in class Devicepublic void shutDown()
shutDown in class Devicepublic void setContrast(int contrast)
contrast - a value within the range [0,255] specifying the contrast
of the LCD
IllegalArgumentException - thrown if the contrast value is out of
rangepublic int getContrast()
public void setBrightness(int brightness)
brightness - a value within the range [0,255] specifying the
brightness of the LCD
IllegalArgumentException - thrown if the brightness value is out of
rangepublic int getBrightness()
public void setText(String text,
int alignment)
text - the text to display on the LCD.alignment - LEFT_ALIGNMENT, RIGHT_ALIGNMENT, or CENTER_ALIGNMENT
IllegalArgumentException - thrown if the alignment is not one of
the predefined constants
public void setTopLineText(String text,
int alignment)
text - the text to set the top line of the LCD toalignment - LEFT_ALIGNMENT, RIGHT_ALIGNMENT, or CENTER_ALIGNMENT
IllegalArgumentException - thrown if the alignment is not one of
the predefined constantspublic String getTopLineText()
public int getTopLineAlignment()
public void setBottomLineText(String text,
int alignment)
text - the text to set the bottom line of the LCD toalignment - LEFT_ALIGNMENT, RIGHT_ALIGNMENT, or CENTER_ALIGNMENT
IllegalArgumentException - thrown if the alignment is not one of
the predefined constantspublic String getBottomLineText()
public int getBottomLineAlignment()
public void clearAll()
public void clearTopLine()
public void clearBottomLine()
public void freeze()
freeze in class Devicepublic void readStateFromRobot()
readStateFromRobot in class Devicepublic boolean getButtonValue(int button)
button - the button number to check
protected DeviceDisplay[] createGUIObjects()
createGUIObjects in class Device
public static void main(String[] args)
throws Exception
args - none
Exception
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||