Parallax 4x16 LCD Help
chris jones
Posts: 391
Hello
i have a parallax 4x16 lcd and i have it working but i need to know how tosend text to the lcd. i currently have the Debug_LCD Driver but it seems to nothave the ability to send a fill string to the screen.
i have a parallax 4x16 lcd and i have it working but i need to know how tosend text to the lcd. i currently have the Debug_LCD Driver but it seems to nothave the ability to send a fill string to the screen.
Comments
Sorry for the lack of information, the project is developed on the propeller chip and i am using a propeller demo board.
CODE BELOW
http://www.parallax.com/Store/Accessories/Displays/tabid/159/CategoryID/34/List/0/SortField/0/Level/a/ProductID/51/Default.aspx
Data sheet
http://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/27976-7-9-ParallaxSerialLCD-v2.1.pdf
I was just typing this as you posted the datasheet:)
CODE SNIPPET
Lcd.str(@Value)
Or if you want to insert a string of text without a variable array, you could do this..
Lcd.str(string("What hath God wrought?"))
OR... Were you trying to display a decimal number as a value? If so, then you would need to change the line of code so that it will display a single byte/word/long of data as a ASCII string.. Like such
Lcd.dec(value)
lcd.dec(value)
That should give you what you want... Yeah, i thought that you wanted to do was send a string of characters from an array to the LCD. You just want to display a byte of data as a ascii string. The above should work. Sorry for the confusion:)
Consider a string is only a byte array, with the end of the sting identified by a 0. A "string" function returnd directly the address, and this is expected by the sting handling functions.
If you have the string in a DAT section you should use the @, same if you create a string as an array.
if you send
lcd.str(string("hello"))
does it work?
Massimo
"numbers" and "simple numbers" are a good solution. Simple numbers is less powerful but easier to use, and sometimes even better.
This way you have an already formatted string available.
if num is you simple numbers object,
lcd.str(num.dec(1234))
will do all the job for you. If you need more complex formatting decf and decx are available.
Massimo
Thanks