Displaying a changing numerical value on an LCD?
Turnbull
Posts: 7
How·would I display a process variable on an LCD display with a steady name of the variable next to it? Example: "VOLTAGE - 6.330" Obviously the voltage would change. Is this even possible??··
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
Maybe I should have waited to do that......
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Rick
http://www.parallax.com/sx/sxb_examples_apps.asp
I think the Stampworks 2 manual has a section on controlling a parallel LCDs
http://www.parallax.com/dl/docs/books/sw/Web-SW-v2.1.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Rick
I basically had to write a sub in which stripped down the number in common holders. Meaning, I created 4 variables in the beginning of my program, HUNS, TENS, ONES, and INVAL then I would just GOSUB my CONVERT_TO_CHAR routing, which logically just went thru and computed the HUNS, TENS, and ONES of INVAL.
Then I just sent those values + asc(31) i think, and that ended up printing my number.
Every iteration thru, to just replace the number, send (3) backspaces in my case, and just reprint the new value.
Was that it, or am I way off base?
Shawn
' Convert a byte into three ASCII digits and display them on the LCD.
' ASCII 48 is zero, so the routine adds 48 to each digit for display on the LCD.
BCD: let huns= BCDin/100+48 ' How many hundreds?
let tens= BCDin//100 ' Remainder of #/100 = tens+ones.
let ones= tens//10+48 ' Remainder of (tens+ones)/10 = ones.
let tens= tens/10+48 ' How many tens?
let char= huns ' Display three calculated digits.
gosub wr_LCD
let char = tens
gosub wr_LCD
let char = ones
gosub wr_LCD
return
However, you never did answer as to what you are using to actually control the LCD. The PDB is what you plug it into, not what controls it. On the PDB you have to use either a BS1, one of the many types of BS2s or an SX-28.
More than likely, what you have is a plain old BS2, if that's the case please download and go through the StampWorks manual. It will tell you everything you need to know, and most of the info in it is easily adapted to any of the other flavors of BS2s.
I really think you may be over-complicating this a bit [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Rick
Post Edited (RDL2004) : 9/13/2007 11:34:16 AM GMT
www.myke.com/lcd.htm
or maybe www.weethet.nl/english/basicstamp2_lcdcontrol.php
Parallax sells a serial LCD, but if you want a serial controller (sometimes called a "backpack") that you can add to the LCD you already have, try here:
www.wulfden.org/k107/index.shtml
(I really wish Parallax would sell their serial controller separately - hint hint)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Rick
Post Edited (RDL2004) : 9/14/2007 4:42:35 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
Maybe I should have waited to do that......
index = number to display
char = char to display on LCD
DisplayNum:
char = index DIG 1 + 48
GOSUB LCDwr
char = index DIG 0 + 48
GOSUB LCDwr
RETURN
LCDwr:
OUTB = char.HIGHNIB ' output high nibble
PULSOUT E, 1 ' strobe the Enable line
OUTB = char.LOWNIB ' output low nibble
PULSOUT E, 1
HIGH RS ' return to character mode
RETURN