PDA

View Full Version : Display variable at LCD dispaly



hclam
08-09-2005, 04:04 PM
Hi all,

Im using the command line below to display the constant at the LCD display:

SEROUT TxPin, Baudrate19200, ["123"]


Can somebody tell me how to display the variable value at the LCD display? Tq

Bruce Bates
08-09-2005, 05:50 PM
hclam -

You do it the same way that you displayed the constant:

Variable var byte
Variable = 123

SEROUT TxPin, Baudrate19200, ["123"]

SEROUT TxPin, Baudrate19200, [Variable]

Both the PBASIC Stamp Manual, and the PBASIC Stamp Help file are wonderful resources that you might consider using.

Regards,

Bruce Bates

Jon Williams
08-09-2005, 06:24 PM
Use the DEC modifier to convert a numeric value (variable) to text for display on the LCD:

· SEROUT Lcd, Baud, [DEC myVar]

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

Tom-Matrix Orbital
08-10-2005, 02:14 AM
Just curious, but what display are you using?

hclam
08-10-2005, 08:32 AM
I use·'Parallax Serial LCD'. Thank for helping...

I do try out with the solution from all of you, it is work now but it seem like not able to display the floating digits, eg 12.35. What command need to include for displaying floating digit?

Tq

Jon Williams
08-10-2005, 09:20 AM
The BASIC Stamp can't store floats, but it can represent them as fixed -- you have to decide the resolution of your "floating point" number.· Let's say you're using hundredths, so the value 1235 actually represents 12.35.· Here's how you can display that value:

· SEROUT Lcd, Baud, [DEC (myValue / 100), ".", DEC2 myValue)

Here's a hint: a serial LCD can use any of the serial modifiers supported by SEROUT and DEBUG -- so you can use DEBUG to do quick tests before putting code into the program that uses the LCD.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

hclam
08-11-2005, 08:55 AM
Thank a lots!