28029 Parallax Inc, 28029 Datasheet - Page 24

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 12 · Smart Sensors and Applications
Display Numbers with Formatters
Most of the formatters that worked for displaying numbers with the Debug Terminal can
also be used with the Parallax Serial LCD. The
useful, but you can also use
example, if you want to display the decimal value of a variable named
use commands like this:
Example Program - LcdTestNumbers.bs2
Aside from demonstrating that you can display variable values on the serial LCD, this
program also shows what happens if the program sends more than 16 printable characters
to Line 0. It wraps to Line 1. Also, after printing sixteen more characters and filling
Line 1, the text will wrap again, to Line 0.
' Smart Sensors and Applications - LcdTestNumbers.bs2
' Display number values with the Parallax Serial LCD.
' {$STAMP BS2}
' {$PBASIC 2.5}
counter
SEROUT 14, 84, [22, 12]
PAUSE 5
FOR counter = 0 TO 12
NEXT
END
SEROUT 14, 84, [DEC counter, " "]
PAUSE 500
SEROUT 14, 84, [DEC counter]
Enter, save, and run LcdTestNumbers.bs2
Verify that the display resembles Figure 1-11.
VAR
Byte
DIG
,
REP
,
ASC
,
BIN
,
HEX, SDEC
' Target device = BASIC Stamp 2
' Language
' FOR...NEXT loop index
' Initialize LCD
' 5 ms delay for clearing display
' Count to 12; increment at 1/2 s
' Program end
DEC
formatter is probably the most
, and most of the others. For
= PBASIC 2.5
counter
, you can

Related parts for 28029