Shop OBEX P1 Docs P2 Docs Learn Events
Parallel or Serial LCD? — Parallax Forums

Parallel or Serial LCD?

jengeljengel Posts: 3
edited 2006-10-16 23:52 in BASIC Stamp
I have an application that needs to read a sensor and print that value to a parallel 4X20 LCD.

I know how to save a text string as data and print that, so I know the LCD and connections are working.

Is it possible to do this to a parallel LCD or should I get the serial LCD, which looks much easier?

Thanks in advance.

J. Engel

Edit: Added Subject Line

Post Edited By Moderator (Chris Savage (Parallax)) : 10/16/2006 5:25:59 AM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-16 03:04
    Either a serial or a parallel LCD will work. The BS2p series Stamps have built-in support for parallel LCDs, but you can do the same thing with subroutines on other Stamps. I think there's a Nuts and Volts article early on about doing parallel LCDs with non-BS2p Stamps.
  • jengeljengel Posts: 3
    edited 2006-10-16 03:44
    Thanks, Mike...

    I guess I should have been more specific...

    I'm using the BS2 and can save string data with the Msg1 DATA "Line 1" command. The program will print that to the LCD fine. I need to read a variable that can go from 20 to 0 and be able to print the variable value to the LCD. That's where I'm having the problem.

    Thanks.

    J. Engel
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-16 04:59
    So your question is "how do I convert an integer value from 0 to 20 into a character string suitable for displaying on a parallel LCD?"

    I don't recommend modifying the "Line 1" by using WRITE statements (which you can do) because of the limited number of WRITEs you can do to a memory location before it actually wears out.

    You can get the two characters (msd and lsd) of the number with the following two statements (assuming the variable is called 'x'):
    msd = x / 10 + "0"  ' Most Significant Digit
    lsd = x // 10 + "0"  ' Least Significant Digit
    
    


    If you want a leading zero changed to a blank, do:
    if msd = "0" then msd = " "
    
    


    All you have to do is send these characters to the LCD display using whatever routines you use for sending the "Line 1".
  • jengeljengel Posts: 3
    edited 2006-10-16 23:52
    Thanks, that's what I wanted it to do.

    I was stuck in a rut and couldn't get away from my initial line of thought.

    Thanks again for the simple solution.

    J. Engel
Sign In or Register to comment.