Sending a varible to a serial LCD
I have been having trouble sending a varible to the parallax serial LCD.· I am using the SX48 proto board with the internal 4mhz.· I am able to send a string but I can't send a number variable correctly.· It comes out as random characters such as a series of backslashes.· Any help?

Comments
· You need to convert the variable into ASCII characters.
· Here is a routine to convert a Word variable into 5 ASCII digits.
Word_To_Digits SUB 2 Word_To_Digits: tempW = __WPARAM12 char = "0" DO WHILE tempW >= 10000 INC char tempW = tempW - 10000 LOOP SendChar char char = "0" DO WHILE tempW >= 1000 INC char tempW = tempW - 1000 LOOP SendChar char char = "0" DO WHILE tempW >= 100 INC char tempW = tempW - 100 LOOP SendChar char char = "0" DO WHILE tempW >= 10 INC char tempW = tempW - 10 LOOP SendChar char char = "0" + tempW_LSB SendChar char RETURNBean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"You're braver than you believe, stronger than you seem, and smarter than you think" Christopher Robin to Pooh
Post Edited (Bean (Hitt Consulting)) : 8/27/2006 6:52:45 PM GMT
byte_To_Digits:
tempW = __PARAM1
char = "0"
DO WHILE tempW >= 100
INC char
tempW = tempW - 100
LOOP
LCD_OUT char
char = "0"
DO WHILE tempW >= 10
INC char
tempW = tempW - 10
LOOP
LCD_OUT char
char = "0" + tempW
LCD_OUT char
RETURN