Examples | Shop
 
Basic Stamp 2™ Driving a Serial LCD Module
 
The following example application demonstrates a DS-LCDD1, 2 x 16 character LCD Serial Module, powered by a Basic Stamp 2TM microcontroller.
On power up, the Serial LCD displays two lines of text after a 1-second pause.
Basic Stamp is a Registered Trademark of Parallax Inc.

 

'*************************************************************************'
'Description: DS-LCDD1,2 x 16 characters LCD Serial Module controlled by the '
'Basic Stamp 2TM microcontroller, demonstrating text displayed on both LCD '
'lines. '
'Created: 19/08/02 Revision 1.00 '
'Written By: Total Robots (Jamie Finnan) '
'TR-003 '
'Basic Stamp is a Registered Trademark of Parallax Inc. '
'*************************************************************************'
'{$STAMP BS2}
main:
gosub ClearLCD ‘Clear the LCD screen
gosub LCDData ‘Output data to the LCD
goto main
ClearLCD:

SEROUT 9,16780, [254,1] ‘Set command to clear the LCD screen
pause 1000 ‘1 second pause
Return
LCDData:

Serout 9,16780, ["Serial LCD with"] ‘First line of data to LCD
Serout 9,16780, [254,192] ‘Command for cursor to second line
Serout 9,16780, ["BS2 Application"] ‘Second line of data to LCD

Loop
goto Loop
return
'*************************************************************************'


Examples | Shop