28029 Parallax Inc, 28029 Datasheet - Page 281

KIT PARTS SMART SENSORS W/TEXT

28029

Manufacturer Part Number
28029
Description
KIT PARTS SMART SENSORS W/TEXT
Manufacturer
Parallax Inc
Datasheet

Specifications of 28029

Accessory Type
Parts Kit
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
BASIC Stamp® or Javelin Modules
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Other names
28029PAR
Inside the Subroutines - Def_Cust_Char and Disp_Cust_Char
Let's take a look at the
LcdPin, T9600, [Define + custChar]
LCD. That's because
tells the LCD to define Custom Character 0. If you want to define Custom Character 1,
it's 249, and so on up to Custom Character 7, which is 255. So the term
custChar
255 if
After the LCD receives a value between 248 and 255, it expects to receive eight more
bytes, each containing one of the eight horizontal dotted lines that make up a custom
character definition.
EEPROM, starting at
charBase
the starting address of the data. The command
reads a byte of the character definition and stores it in the
time through the
is fetched from EEPROM and stored in the
dotLine
The second time through the
read from EEPROM and sent to the LCD. The third time through, the third byte in the
character definition is fetched and sent, and so on, up to the eighth byte when
to 7.
The
[line + cursor, custChar]
cursor
variable contains either
to character 0 on Line 0.
Disp_Cust_Char
custChar
, which places the cursor where the custom character is to be printed. The
Def_Cust_Char:
is sent to the LCD with the command
SEROUT LcdPin, T9600,
FOR index = 0 TO 7
NEXT
RETURN
can be 248 if
to the
READ charBase + index, dotLine
SEROUT LcdPin, T9600, [dotLine]
Symbol
stores 7.
FOR
[Define + custChar]
...
Define
charBase
NEXT
Def_Cust_Char
The
Line0
subroutine has just one command,
custChar
name of one of the
Line1
loop,
FOR
FOR
is set to 248 in the Constants section. 248 is the value that
or
. It sends two values to the LCD. The first is
.
...
is the constant value 148, which points to character 0 on
...
Line1
index
NEXT
NEXT
stores 0, or 249 if
Keep in mind that the program's Main Routine sets
Chapter 7: LCD Bar Graphs for Distance and Tilt · Page 269
.
subroutine (below). The first command,
loop,
loop in
is 0, so the first byte in the character definition
Line0
dotLine
DATA
sends a value between 248 and 255 to the
index
SEROUT LcdPin, T9600, [dotLine]
is a the constant value 128, which points
READ charBase + index, dotLine
directives, which is a constant equal to
Def_Cust_Char
' Define Custom Character 2
' 7 bytes, define 7 dotted lines
' Get byte for dotted line
' Send it to the LCD
variable. Then, the value stored by
custChar
is now 1, and so the second byte is
dotLine
SEROUT LcdPin, T9600,
stores 1, and so on up to
reads each byte in
variable. The first
index
Define +
line +
SEROUT
line
gets
.

Related parts for 28029