5: BASIC Stamp Command Reference – LCDCMD
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 165
Demo Program (LCDINIT.bsp)
' This program demonstrates initialization and printing on a 2 x 16 character LCD display.
' The set of "LCD constants", below, are provided as pre-defined and useful LCD commands,
' though only a few are actually used in this program.
'{$STAMP BS2p} 'STAMP directive (specifies a BS2p)
'-----Define LCD constants-----
WakeUp CON %00110000 'Wake-up
FourBitMode CON %00100000 'Set to 4-bit mode
OneLine5x8Font CON %00100000 'Set to 1 display line, 5x8 font
OneLine5x10Font CON %00100100 'Set to 1 display line, 5x10 font
TwoLine5x8Font CON %00101000 'Set to 2 display lines, 5x8 font
TwoLine5x10Font CON %00101100 'Set to 2 display lines, 5x10 font
DisplayOff CON %00001000 'Turn off display, data is retained
DisplayOn CON %00001100 'Turn on display, no cursor
DisplayOnULCrsr CON %00001110 'Turn on display, with underline cursor
DisplayOnBLCrsr CON %00001101 'Turn on display, with blinking cursor
IncCrsr CON %00000110 'Auto-increment cursor, no display shift
IncCrsrShift CON %00000111 'Auto-increment cursor, shift display left
DecCrsr CON %00000100 'Auto-decrement cursor, no display shift
DecCrsrShift CON %00000101 'Auto-decrement cursor, shift display right
ClearDisplay CON %00000001 'Clear the display
HomeDisplay CON %00000010 'Move cursor and display to home position
ScrollLeft CON %00011000 'Scroll display to the left
ScrollRight CON %00011100 'Scroll display to the right
CrsrLeft CON %00010000 'Move cursor left
CrsrRight CON %00010100 'Move cursor right
MoveCrsr CON %10000000 'Move cursor to position (must add address)
MoveToCGRAM CON %01000000 'Move to CGRAM position (must add address)
'-----Main Routines-----
Init:
PAUSE 1000
GOSUB InitLCD
Start:
LCDOUT 1, ClearDisplay, ["Hello World!"]
LCDOUT 1, M64, ["How are you?"]
STOP
'-----Subroutines-----
InitLCD:
LCDCMD 1, WakeUp 'Send wakeup sequence to LCD
PAUSE 10 'These pauses are necessary to meet the LCD specs
LCDCMD 1, WakeUp
PAUSE 1
LCDCMD 1, WakeUp
PAUSE 1
p
2
Содержание BASIC Stamp 1
Страница 1: ...BASIC Stamp Programming Manual Version 2 0c...
Страница 30: ...Introduction to the BASIC Stamps Page 28 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 90: ...BUTTON BASIC Stamp Command Reference Page 88 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 118: ...END BASIC Stamp Command Reference Page 116 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 128: ...FREQOUT BASIC Stamp Command Reference Page 126 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 196: ...NAP BASIC Stamp Command Reference Page 194 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 206: ...OWIN BASIC Stamp Command Reference Page 204 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 214: ...OWOUT BASIC Stamp Command Reference Page 212 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 216: ...PAUSE BASIC Stamp Command Reference Page 214 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 226: ...POLLMODE BASIC Stamp Command Reference Page 224 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 232: ...POLLOUT BASIC Stamp Command Reference Page 230 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 236: ...POLLRUN BASIC Stamp Command Reference Page 234 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 240: ...POLLWAIT BASIC Stamp Command Reference Page 238 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 262: ...RCTIME BASIC Stamp Command Reference Page 260 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 274: ...RUN BASIC Stamp Command Reference Page 272 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 310: ...SEROUT BASIC Stamp Command Reference Page 308 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 324: ...STOP BASIC Stamp Command Reference Page 322 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...