Shop OBEX P1 Docs P2 Docs Learn Events
Printing Variables on a 2x16 LCD — Parallax Forums

Printing Variables on a 2x16 LCD

IpreferJavaIpreferJava Posts: 1
edited 2010-11-18 12:41 in BASIC Stamp
Hi Forum!
this is my first time on this website, and i was wondering if any could help us on our school project.

Our school project dictates us to get a temperature from a DS1620 chip and print it on a 2x16 LCD screen.

We were given 2 programs to combine. One that reads the temperature, the other that runs the LCD screen.

All in all it seems like we got it, UNTIL we ran into the problem of getting the temperature variable to print on the LCD screen.

Can anyone help?

~Thanks!
the noobs.

P.S. our code is attached.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-11-18 12:41
    Probably what you're running into is that the LCD code is designed to display one character at a time while, with the DEBUG statement, you're used to displaying strings and numbers directly (numbers with DEC).

    With strings, you're going to have to do them one character at a time, so "Hello" becomes: output "H", output "e", output "l", output "l", output "o". For numbers it's a little harder. To output the digits of a number, use value DIG digit where digit is the power of 10 of the digit from value. If you want to output numbers from 0000 to 9999 from value, you'd get: output (value DIG 3)+"0", output (value DIG 2)+"0", output (value DIG 1)+"0", output (value DIG 0)+"0".

    By output, I mean whatever code you need to send a character to the display. Lookup the DIG operator in the Stamp Manual or the Stamp Editor's on-line help for details.
Sign In or Register to comment.