Parallax, Inc. • BS2p “Plus Pack” (#45184) • 10/2001
Page 11
PP_LCDODO.BSP
•
Connect LCD to the BS2p Demo Board X5
•
Install jumper X6
•
Adjust contrast pot for best display
' -----[ Title ]----------------------------------------------------------------
'
' BS2p Plus Pack
'
' File...... PP_LCDODO.BSP
' Purpose... Advanced LCD Demo - rewriting CGRAM on the fly
' Author.... Parallax, Inc.
' E-mail.... [email protected]
' Started...
' Updated... 26 SEP 2001
' {$STAMP BS2p}
' -----[ Program Description ]--------------------------------------------------
'
' This program demonstrates LCD character animation by writin g to the
' character map (in CGRAM) for a character that is already displayed. The
' refresh cycle of the LCD will cause the character to change when its
' map is changed. This technique (originally by Scott Edwards) allows
' the programmer to create adva nced animations by storing character (cell)
' definitions in the Stamp's EEPROM.
'
' This program displays a rolling odometer type reading (last digit
' "rolls"). Character definitions are copied from the standard set
' (using "LCD Character Creator" software from Parallax).
'
' Each character definition is separated by 2 blank lines in order to create
' 10 lines per "rolling" character. This makes the math for calculating
' the starting line of the roller very easy.
'
' To run this program on the BS2p De mo Board, connect the LCD and install
' Jumper X6. Adjust contrast pot for best display.
'
' Refer to the Hitachi HD44780 documentation for details on LCD control.
' -----[ Revision History ]-----------------------------------------------------
'
' -----[ I/O Definitions ] ------------------------------------------------------
'
LCDpin CON 0 ' connect LCD to OutL
' -----[ Constants ]------------------------------------------------------------
'
NoCmd CON $00 ' No command in LCDOUT
ClrLCD CON $01 ' clear the LCD
CrsrHm CON $02 ' move cursor to home position
CrsrLf CON $10 ' move cursor lef t
CrsrRt CON $14 ' move cursor right
DispLf CON $18 ' shift displayed chars left