English
Language : 

805-00012 Datasheet, PDF (3/11 Pages) List of Unclassifed Manufacturers – Parallax Serial LCD
Displaying Text
Now that the LCD is set up, it’s time to start sending text to the display. To display a character of text on
the Serial LCD, simply send the ASCII code of that character to the Serial LCD over the serial port at the
correct baud rate.
When a character is received, the Serial LCD displays that character at the current cursor position and
then moves the cursor one position to the right. When you first turn on the LCD, the cursor is in the
leftmost position on the top line, as you might expect. The short bar on the bottom of the character
shows where the cursor is positioned currently.
Once you’ve sent a full line characters to the LCD, you will notice that the cursor automatically wraps
around to the leftmost position of the second line, just like the text in a book. The text will wrap like this
at the end of every line, with the end of the bottom line wrapping back around to the top line of the LCD.
The text will never “run off” the display; you’ll always see all of the characters you send.
Example code is provided below. You may download the example code files from the 27976, 27977, or
27979 product pages at www.parallax.com; just enter any of these product numbers in the “search” field
on the home page
BASIC Stamp® 2 Example Code
You may download the example code from the 27976, 27977, or 27979 product pages at
www.parallax.com; just enter any of these product numbers in the “search” field on the home page. Try
the following code on your BASIC Stamp 2 to send a text string to the LCD display. First, set the baud
rate on your Serial LCD to 19,200. Then, load the code below into your BASIC Stamp 2 and run it.
You will see the text string show up and wrap to the second line of the display.
In all of your Serial LCD code, you should pause for 100 ms at start-up to give time for the Serial LCD to
initialize. You should also set the serial port pin on the BASIC Stamp to HIGH before the 100 ms start-up
delay, as this is the normal state of a serial port when it isn’t sending any data.
' {$STAMP BS2}
' {$PBASIC 2.5}
TxPin
Baud19200
CON 0
CON 32
HIGH TxPin
PAUSE 100
' Set pin high to be a serial port
' Pause for Serial LCD to initialize
SEROUT TxPin, Baud19200, ["Hello, this text will wrap."]
Propeller P8X32A Example Code
Try the following code on your Propeller to send a text string to the LCD display. First, set the baud rate
on your Serial LCD to 19,200. Then, load the code below into your Propeller and load RAM or EEPROM.
You will see the text string show up and wrap to the second line of the display.
In all of your Serial LCD code, you should wait for 100 ms after starting the FullDuplexSerial.spin object,
to give the object and the Serial LCD time to initialize. The FullDuplexSerial.spin object is included with
the Propeller Tool.
Copyright © Parallax Inc.
Parallax Serial LCDs (#27976, 27977, 27979)
v3.1 3/11/2013 Page 3 of 11