5: BASIC Stamp Command Reference – LCDCMD
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 161
shown above. This process is known as initializing the LCD and is the
first thing your program should do upon starting up. The following code
is a good example of LCD initialization.
InitLCD: 'LCD's usually take more than 500
µ
s to power-up. This pause is
PAUSE 1000 'to keep the BASIC Stamp from talking to the LCD too early.
LCDCMD 1, 48 'Send wakeup sequence to LCD (three Wake-Up (48) commands)
PAUSE 10 'This pause is necessary to meet the LCD specs
LCDCMD 1, 48
PAUSE 1 'This pause is necessary to meet the LCD specs
LCDCMD 1, 48
PAUSE 1 'This pause is necessary to meet the LCD specs
LCDCMD 1, 32 'Set data bus to 4-bit mode
LCDCMD 1, 40 'Set to 2-line mode with 5x8 font
LCDCMD 1, 8 'Turn display off
LCDCMD 1, 12 'Turn display on without cursor
LCDCMD 1, 6 'Set to auto-increment cursor (no display shift)
LCDCMD 1, 1 'Clear the display
This initialization code is the most commonly used sequence for a 2 x 16
and 4 x 20 LCD display (the 2-line mode instruction sets the 4 x 20 to 4-line
mode). The PAUSE 1000 command is optional, but only if your program
takes more than approximately 700 ms before it executes the InitLCD code
above. Without it, upon powering your circuit, the BASIC Stamp may talk
to the LCD too early, the LCD will then miss some of the commands and
the display will operate strangely, or not at all.
Do not change the "wake-up" and "4-bit mode" sequence commands.
However, the commands below the line that says, "Set data bus to 4-bit
mode" may be modified to set other desired modes.
Table 5.27 shows the most commonly used LCD commands. Here's an
example:
LCDCMD 1, 16
This will make the LCD's cursor move left by one character (16 is the
Cursor Left command), even if the cursor is not visible. The next character
printed on the display (with the LCDOUT command) will appear at the
current cursor's location. Here's another example:
LCDCMD 1, 128 + 64
The above command will move the cursor to the first character position on
the second line (on a 2 x 16 display). 128 is the Move To Display Address
C
OMMON
LCD
COMMANDS
.
Содержание 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...