122-28029 Parallax Inc, 122-28029 Datasheet - Page 27

GUIDE STUDENT SMART SENSORS

122-28029

Manufacturer Part Number
122-28029
Description
GUIDE STUDENT SMART SENSORS
Manufacturer
Parallax Inc
Datasheet

Specifications of 122-28029

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Smart Sensors
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Here's a code block that will make the text "Line 1" slide across the display's bottom line,
from right to left.
Example Program - CursorPositions.bs2
This program introduces a few basic cursor placement tricks.
' Smart Sensors and Applications - CursorPositions.bs2
' Display number values with the Parallax Serial LCD.
' {$STAMP BS2}
' {$PBASIC 2.5}
index
character
offset
SEROUT 14, 84, [22, 12]
PAUSE 500
' Display evenly spaced characters on Line 0 every 200 ms.
SEROUT 14, 84, 200, [128, "L",
PAUSE 1000
FOR index = 9 TO 0
NEXT
Look over CursorPositions.bs2 and try to predict what the program will make the
LCD display do. Also try to predict the sequence and timing.
Enter, save, and run CursorPositions.bs2.
Compare the LCD display's behavior to your predictions.
SEROUT 14, 84, [148 + index, "Line 1 "]
PAUSE 100
Erasing Characters
You can always erase a character by placing the cursor where you want it and then sending
the space " " character to overwrite whatever might be there. This is why the text "Line 1 "
has a space after the "1" character, to erase the characters to its right as the text moves left.
VAR
VAR
VAR
' IMPORTANT: Leave a space after the 1 in "Line 1 "
131, "I",
134, "N",
137, "E",
140, "-",
143, "1"]
Nib
Byte
Byte
Chapter 1: Parallax Serial LCD Display · Page 15
' Target device = BASIC Stamp 2
' Language
' FOR...NEXT loop index
' Character storage
' Offset value
' Initialize LCD
' 1/2 second delay
= PBASIC 2.5

Related parts for 122-28029