27220 Parallax Inc, 27220 Datasheet - Page 96

BOOK STAMPWORKS

27220

Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet

Specifications of 27220

Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
Page 86 · StampWorks
The standard LCD font is five bits wide by seven bits tall. You can create custom
characters that are eight bits tall, but as explained before the eighth line is generally
reserved for the underline cursor.
Here’s an example of a custom character
definition:
The shape of the character is determined by the ones and zeros in the data bytes. A
1 in a given bit position will light a pixel; zero will extinguish it.
The bit patterns for custom characters are stored in the BASIC Stamp’s EEPROM with
DATA statements. To move the patterns into the LCD the cursor is moved to the
CGRAM then each data byte is written. Since the LCD has been initialized for auto-
incrementing, there is no need to address each data byte individually. Before the
characters can be used, the display must be returned to “normal” mode by moving
the cursor back to the DDRAM area. The usual method is to clear the display or
home the cursor.
Interestingly, the LCD retrieves the bit patterns from memory while refreshing the
display. In advanced applications, the CGRAM memory can be updated while the
program is running to create unusual display effects.
The heart of this program is the animation loop. This code grabs a character from
the second message, then, for each character in that message, displays the
animation sequence at the desired character location on the second line of the LCD.
A LOOKUP table is used to cycle the custom characters for the animation sequence.
At the end of the sequence, the new character is revealed.

Related parts for 27220