Shop OBEX P1 Docs P2 Docs Learn Events
Variable on LCD — Parallax Forums

Variable on LCD

Dan TaylorDan Taylor Posts: 207
edited 2008-05-17 16:59 in BASIC Stamp
Hey all,
I've just recently bought the Parallax 2x16 Serial LCD and was wondering if it is possible to display the state of a variable on it. Like you can on the Debug Menu.

DEBUG ? Variable

And thank you all for your help in the past.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dan Taylor

Comments

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2008-05-17 15:37
    Hi Dan, what you ask is exactly what the LCD is intended for. To display characters on the LCD you would use SEROUT to send ASCII character codes as a string or an individual character.

    If you read the documentation at this link http://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/SerialLCD-v2.0.pdf·it tells how to configure your display and gives code snippets to get you started.

    You will want to keep track of the cursor position and be aware of what your program is displaying so that you can·format the way the display looks and prevent one line overwriting another at the wrong time. You will achieve this by sending control codes to position the cursor or clear the screen before you send your characters, it's all listed in the docs.

    Something simple might look like the following

    x=4

    SEROUT tx,baud,[noparse][[/noparse]22]·· ' turn the lcd on , no cursor , no blink

    SEROUT tx,baud,[noparse][[/noparse]128]· ' place the cursor at line 0 position 0

    SEROUT tx,baud,[noparse][[/noparse]"x=",DEC x]· ' display the variable on the LCD

    hope this helps

    Jeff T.
  • Dan TaylorDan Taylor Posts: 207
    edited 2008-05-17 16:59
    Thanks Jeff,
    Thats exactly what I wanted!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dan Taylor
Sign In or Register to comment.