Giving Commands to the 2x20 Serial LCD from Matrix Orbital
crgwbr
Posts: 614
Hey Everyone,
I'm working on a project that's using the 2x20 LCD display from Matrix Orbital, sold by Parallax.· I can write words to it just fine, the problem comes when I try to give it commands, like clear screen.· Acording to the manual these are the commands for clear screen...
Hexadecimal 0xFE 0x58
Decimal 254 88
ASCII 254 “X”
I can't seem to put these into a program without the BS Editor raising an Error.· Does anyone have an idea of how to use them?
Thanks Everyone
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
I'm working on a project that's using the 2x20 LCD display from Matrix Orbital, sold by Parallax.· I can write words to it just fine, the problem comes when I try to give it commands, like clear screen.· Acording to the manual these are the commands for clear screen...
Hexadecimal 0xFE 0x58
Decimal 254 88
ASCII 254 “X”
I can't seem to put these into a program without the BS Editor raising an Error.· Does anyone have an idea of how to use them?
Thanks Everyone
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
Comments
·
·· The following should get you going…
·
·SEROUT LCD_Pin, Baud, [noparse][[/noparse]254, 88, “Hello World!”]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
Chris's answer was kindly, short and fixed your problem, but I'm not sure how much you learned from that. PBASIC will accept any of the number/letter representations which you offered. You just need to tell the PBASIC IDE which representation you are using, as it's certainly no mind reader.
ASCII - Numbers and letters are plain, and all are in quotation marks:
· "A", "B", C", "Hello world", etc. per se
· "1" ," 2", "3", "4", "10", "20", "40", "50", "100" etc. per se
HEX (hexidecimal) - Alphanumeric characters must be preceeded by the Hex designator which is the $ prefix, as follows:
· Decimal 1, 2, 3, 4, 5 , 10, 16
· Hex $01, $02, $03, $05, $0A, $20
DECIMAL - Decomal numbers are plain and without any prefix:
1, 2, 3, 4, 5, 10, 20, 50, 100, etc.
BINARY - Numbers consist of NOTHING but 1's and 0's and are predeeded by the binary designator which is a % sign:
%0, %1, %01, %11, %1010 0101, etc
=-=-=-=-=-=-=-=
I hope that is helpful.
Regards,
Bruce Bates
Post Edited (Bruce Bates) : 10/11/2006 9:48:55 PM GMT
After Chris showed me how to use decimal, I was trying to figure out Hex. I ended up using the HEX command; I almost scraped the LCD by accedently sending it a new baud rate. Wow am I glad it had a manual reset.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life