|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--stamp.peripheral.appmod.LedTerminal
This LedTerminal class is for Parallax's "LED Terminal AppMod" (part #29112)
The LED Terminal AppMod provides an interface for direct interaction between a user and the host. It offers a four digit alphanumeric LED display, six individual LEDs, four pushbuttons, and a real-time clock.
Communication with the AppMod is performed, serially, via the Javelin's I/O pin #6 using the UART class. Most of the LED Terminal features are available to you through methods within the LedTerminal class. If you would like to experiment with the AppMods other program strings, they are as follows: (Note: All data must be sent as characters, in one continuous string)
ASC - Send ASCII (text) data as well as LED control to the AppMod (4 char)(3 char) (4 char) (1 char) (1 char) [init] [directive] [ASCII Data] [LED highbyte] [LED lowbyte] !LT0 ASC data 0x00 0x00 BCD - Show Binary Coded Decimal data as received via serial interface. Note: data will be displayed as Hex values 0-9, A-F (4 char)(3 char) (4 char) (1 char) (1 char) [init] [directive] [binary Data] [LED highbyte] [LED lowbyte] !LT0 BCD data 0x00 0x00 BIN - Show decimal value of HEX input. Note: data consists of 2 bytes (0-270F) will be converted to decimal (0-9999) (4 char)(3 char) (2 char) (1 char) (1 char) [init] [directive] [binary Data] [LED highbyte] [LED lowbyte] !LT0 BIN byte,byte 0x00 0x00 RTI - Real-Time clock Initilization. Set the real-time clock. (4 char)(3 char) (4 char) (2 char) [init] [directive] [binary Data] [unused] !LT0 RTI day,hour,min,sec 0x00,0x00 RTH - Real-Time clock Hide. Do not display real-time clock. (4 char)(3 char) [init] [directive] !LT0 RTH RTS - Real-Time clock Show. Display the real-time clock. (4 char)(3 char) [init] [directive] !LT0 RTS To control the LED's you will need two bytes: highbyte & lowbyte highbyte lowbyte XXXXXX00 00000000 || |||||||`-> Decimal Point #1 (Right-most, Least Significant digit) || ||||||`--> Decimal Point #2 . || |||||`---> Decimal Point #3 . || ||||`----> Decimal Point #4 (Left-most, Most Significant digit) || |||`-----> LED #1 (Right-most) || ||`------> LED #2 . || |`-------> LED #3 . || `--------> LED #4 (Left-most) |'----------> Colon mini-LED (top) `-----------> Colon mini-LED (bottom)
Note: The Javelin's current UART class version 1.0 (IDEv2.01) is designed for single-direction communication on a given I/O pin. With this limitation, the LedTerminal.java class can not receive serial data from the Led Terminal AppMod (such as the state of the buttons)
Field Summary | |
static boolean |
colonBot
Colon (Bottom) |
static boolean |
colonTop
Colon (Top) |
static boolean |
dec1
Decimal LED Display #1 (Right most) |
static boolean |
dec2
Decimal LED Display #2 (2nd from right) |
static boolean |
dec3
Decimal LED Display #3 (2nd from left) |
static boolean |
dec4
Decimal LED Display #4 (Left most) |
static boolean |
led1
Discrete LED #1 (Right most) |
static boolean |
led2
Discrete LED #2 (2nd from right) |
static boolean |
led3
Discrete LED #3 (2nd from left) |
static boolean |
led4
Discrete LED #4 - (Left Most) |
static char |
zero
Null character |
Method Summary | |
void |
banner(String s,
int wait)
Scrolls a message across the display. |
void |
clear()
This will turn all LEDs off and clear the screen. |
void |
direct(String xmit)
This routine will give you direct access over the AppMod. |
void |
direct(StringBuffer xmit)
This routine will give you direct access over the AppMod. |
void |
display(String msg,
int wait)
This will display a message. |
void |
displayTime(boolean display)
This method will display or hide the time |
void |
setTime(int day,
int hour,
int min,
int sec)
The setTime method will set the internal clock, and display it. |
Methods inherited from class java.lang.Object |
equals |
Field Detail |
public static final char zero
public static boolean dec1
public static boolean dec2
public static boolean dec3
public static boolean dec4
public static boolean led1
public static boolean led2
public static boolean led3
public static boolean led4
public static boolean colonTop
public static boolean colonBot
Method Detail |
public void banner(String s, int wait)
String s="Parallax Inc";
msg.banner(s,4000);
s
- String to be scrolledwait
- delay: 1 unit ~ 1/10 milisecondpublic void direct(StringBuffer xmit)
xmit
- - Constructed data packet to be transmittedpublic void direct(String xmit)
xmit
- - Constructed data packet to be transmittedpublic void display(String msg, int wait)
msg
- Message to be displayedwait
- delay: 1 unit ~ 1/10 milisecondpublic void clear()
public void setTime(int day, int hour, int min, int sec)
day
- Time in day(s): 0-99hour
- Time in hour(s): 0-23min
- Time in minute(s): 0-59sec
- Time in second(s): 0-59public void displayTime(boolean display)
display
- - Set TRUE to display time, set to FALSE to hide time
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |