28029 Parallax Inc, 28029 Datasheet - Page 38

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
Page 26 · Smart Sensors and Applications
message is larger than the display window, stopping at the left edge of the display will
keep the rest of the message from becoming visible.
To get text to scroll across just one line, the program has to start with the first character in
a message and display it at the rightmost character. After a short delay, the program has
to move the cursor to the second character from the right, and print both the first and
second characters. It has to continue this process until the cursor gets to the left of the
display. Then, the cursor has to be repeatedly repositioned to that same location as
sixteen-character portions of the message are displayed, making the message appear to
shift from right to left, one character at a time.
The programming technique for this process is called sliding-window. Aside from being
useful for the Parallax LCD, sliding window is what you see when you scroll text up and
down in programs like the BASIC Stamp Editor and your web browser. It's also used in
programs for transmitting and collecting TCP/IP packets. So every time you open your
web browser, there's more than one instance of sliding-window code at work in the
background.
A Configurable Scrolling Subroutine
This next example program features a subroutine that is convenient for displaying a
variety of scrolling messages with minimal work. All it involves is putting the messages
in
the scrolling subroutine.
Here are some example
The first text message begins at an EEPROM address equal to the value of the
symbol, which has been set to 2 with the
The address after the end of
Message2
variables equal to the values of
for a variety of messages.
DATA
directives preceded with Symbol names, setting a few variables, and then calling
Message1
Message2
Message3
Message4
label, which is also the beginning of the second message. Since you can set
DATA @ 2, "Message "
DATA
DATA
DATA
DATA
Message1
directives.
Message1
"again"
"Larger message, going faster"
is EEPROM address 11. This is denoted by the
to
DATA
Message4
directive's optional
, it's an especially flexible system
@Address
Message1
argument.

Related parts for 28029