Shop OBEX P1 Docs P2 Docs Learn Events
Using Parallax LCD — Parallax Forums

Using Parallax LCD

KivistoKivisto Posts: 17
edited 2008-11-30 04:51 in BASIC Stamp
Hey guys,

I just ordered a Parallax Serial LCD to interface with my BS2. I'll be using the same code many of you guys have been helping me with.
The reason I went with the Parallax LCD is because it seems pretty simple to interface. I have no experience interfacing or working with LCDs, so I was hoping I could get some guidance in working with the following code excerpt.

X VAR Word
X = 500

Main:
IF (IN0=1) THEN START
GOTO MAIN

Start:
X = X - 1
DEBUG ? X, CR
IF (X=0) THEN COMPLETE
DO UNTIL: IN0=0
LOOP
GOTO MAIN

Complete:
OUT1 =1
DEBUG "COMPLETE", CR




Basically, I want to take what I have going to the debugger and output that to the Parallax serial LCD. Can someone make some suggestions as to the simplest way to adapt this or write this in? I'd greatly appreciate the help. Thanks

-Kivisto

Comments

  • SRLMSRLM Posts: 5,045
    edited 2008-11-29 21:48
    Suggestion? Search the forums (it's been done before), and look up in the Syntax Manual the DEBUG and SEROUT commands. Figure out how the SEROUT command differs from the DEBUG command, and what sort of commands the LCD is looking for.
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-11-29 21:52
    This (attached) isn't actual running code, but should show you basically how to do it.

    I learned this from reading the documentation from the webpage for the LCDs:

    [noparse][[/noparse]url]http://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/SerialLCD-v2.0.pdf[noparse][[/noparse]/url]

    You should make it a habit to carefully read the documentation for everything you buy from Parallax. It's almost always enough to get you up and running. In fact it's one of the main reasons to buy these things from Parallax - there's no way in the world I'd have figured any of this out myself, at least in any reasonable amount of time.
  • KivistoKivisto Posts: 17
    edited 2008-11-30 02:20
    Thanks sylvie. I think I see what you're doing in your code snippet. I was hoping it would be essentially as easy as outputting to the debugger, which it seems like it is.


    SEROUT LCDPin, LCDBaud, [noparse][[/noparse]DEC (tF/10), ".", DEC1 tF, "F", CR]
    
    



    I assume this line outputs a temperature in "XX.X F" format? Another question is does this work well for a constantly changing value? Say
    your temperature is constantly changing on the fly, does this one line of code constantly keep the current temperature on the LCD, or is some kind of
    refresh required? Thanks for your help.
  • MSDTechMSDTech Posts: 342
    edited 2008-11-30 04:51
    You will need to re-read the temperature and send the data to the LCD. You can put this into a DO..Loop or a For Next type structure depending on the other things you want done while it's running.
Sign In or Register to comment.