EasyManua.ls Logo

Parallax BASIC Stamp 2e - Page 170

Default Icon
353 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
LCDIN - BASIC Stamp Command Reference
Page 168 BASIC Stamp Programming Manual 2.0b www.parallaxinc.com
The LCDIN command is used to send one instruction and then receive at
least one data byte from the LCD's Character RAM or Display RAM. The
following is an example of the LCDIN command:
Char VAR BYTE
LCDIN 1, 128, [Char]
The above code will read the character value at location 0 of the DRAM.
See the "Character Positioning" section, below, for more information.
The LCDIN command actually uses more than just the I/O pin specified
by the Pin argument. The LCDIN command requires seven I/O pins. This
is because the standard LCD displays have a parallel interface, rather than
a serial one. The Pin argument can be the numbers 0, 1, 8 or 9 and will
result in the use of the I/O pins shown in Table 5.29. Please refer to the
LCDCMD command description for information on properly wiring the
LCD display.
When the LCD is first powered-up, it will be in an unknown state and
must be properly configured before sending commands like the one
shown above. This process is known as initializing the LCD and is the
first thing your program should do upon starting up. Please refer to the
LCDCMD command description for information on properly initializing
the LCD display.
The LCDIN command's InputData argument is similar to the SERIN
command's InputData argument. This means data can be received as
ASCII character values, decimal, hexadecimal and binary translations and
string data as in the examples below (assume the LCD display has "Value:
3A:101" starting at the first character of the first line on the screen).
Value VAR BYTE(13)
LCDIN 1, 128, [Value] 'receive the ASCII value for "V"
LCDIN 1, 128, [DEC Value] 'receive the number 3.
LCDIN 1, 128, [HEX Value] 'receive the number $3A.
LCDIN 1, 128, [BIN Value] 'receive the number %101.
LCDIN 1, 128, [STR Value\13] 'receive the string "Value: 3A:101"
Tables 5.30 and 5.31 list all the available conversion formatters and special
formatters available to the LCDIN command. See the SERIN command for
additional information and examples of their use.
A SIMPLE LCDIN EXAMPLE.
T
WO VERY IMPORTANT STEPS:
1) W
IRING THE BS2P TO AN LCD.
2)
INITIALIZING THE LCD.
R
ECEIVING FORMATTED DATA.

Table of Contents

Related product manuals