Display voltage on LCD
snapcount
Posts: 7
I'm using the StampWorks kit and got the voltage measurement project working using the ADC. I'm attempting to to display the scaled value of the measurement stored in the variable mVolts, on the included LCD.
If I do the following:
' Get the first digit
char = mVolts DIG 3
'convert to ASCII
char = char + 48
Send it to the LCD I get garbage chars ?/ ?/ etc
If I define char as 3, i.e., char = 3 instead of char = mVolts DIG 3, I see a 3 on the LCD.
I'm guessing my problem is that the number is not being stored in mVolts the way I think it or something to that effect. The BS math and working within word/byte boundaries is still taking some getting used to so I appologize if this is a really lame question. Any ideas?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Roy Johnson
www.webgui.org
Check out WebGUI, a free and open source content management system and application framework.
Meetings: None of us are as dumb as all of us
If I do the following:
' Get the first digit
char = mVolts DIG 3
'convert to ASCII
char = char + 48
Send it to the LCD I get garbage chars ?/ ?/ etc
If I define char as 3, i.e., char = 3 instead of char = mVolts DIG 3, I see a 3 on the LCD.
I'm guessing my problem is that the number is not being stored in mVolts the way I think it or something to that effect. The BS math and working within word/byte boundaries is still taking some getting used to so I appologize if this is a really lame question. Any ideas?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Roy Johnson
www.webgui.org
Check out WebGUI, a free and open source content management system and application framework.
Meetings: None of us are as dumb as all of us
Comments
Can you post the whole program ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"I reject my reality, and substitute yours." NOT Mythbusters
·
I really appreciate your response but I actually got it to work on my own. I took a day away from the project and came back with a fresh brain. I had several bugs (introduced from debug code, etc.) Works great now. Thanks again for the reply.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Roy Johnson
www.webgui.org
Check out WebGUI, a free and open source content management system and application framework.
Meetings: None of us are as dumb as all of us