Displaying Variables
eman53132
Posts: 6
I am a student at UW-Platteville doing a project for my integrated circuits class.· I am using a Basic Stamp 2, DS1620 Temperature chip, and Hitachi LCD display.· I need to·display the variable temperature·on the LCD panel.· In Basic Stamp what·is the command to display·the temperature data from the chip to the LCD.··All of our components are working properly on their own.
·
·
Comments
·
·· Is this a Serial or Parallel LCD Display?· That will greatly depend on how you go about displaying information on the display, since a serial display will be able to use formatters, whereas the parallel display will not.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
·
·· With a Parallel Display it is not a problem, but you cannot use SEROUT and therefore you do not have access to these formatters.· It would help to know exactly what you’re trying to display, but have you tried using the code on our Parallel LCD Page?· It will certainly get you started accessing and using the display with a BASIC Stamp.
http://www.parallax.com/detail.asp?product_id=603-00006
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
With an LCD panel, to display text I·send "Hello World" to the LCD panel, character by character, and display it on the panel.· Or "473" can be displayed the same way (as characters in quotes).· But how do I display the current numerical value of a variable on an LCD panel?· The topic of displaying variable numerical values as they change on an LCD panel doesn't seem to be addressed in the examples provided.· Any light (or links to info) that you can shed on the topic would be much appreciated.
Thanks!
Charlie
·
·· Better examples are contained in our Stamp Works manual (page 73 on through page 92), at the following link.· The source code is at the second link.· I hope this helps.
http://www.parallax.com/dl/docs/books/sw/Web-sw-v2.0.pdf
http://www.parallax.com/dl/src/prod/StampWorks-2.0-Files.ZIP
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
' {$STAMP BS2}
E· CON· 0· 'LCD Enable pin (1 = enabled)
RS· CON· 3· 'Register Select (1 = char)
LCDbus· VAR· OUTB· '4-bit LCD data bus
ClrLCD· CON· $01
CrsrHm· CON· $02
CrsrLf··· CON· $10
CrsrRt··· CON· $14
DispLf··· CON· $18
DispRt· CON· $1C
DDRam· CON· $80
y······ CON·· $37······· 'Display 7 for y value
char· VAR· Byte
index· VAR· Byte
x···· VAR·· Word········ 'Loop counter
Msg· DATA· "y is ", y ,"; x is ", x , 0···· 'Here I would like to show the current value of x - How??
Initialize:
DIRL = %11111101
LCD_Init:
PAUSE 500
LCDbus = %0011
PULSOUT E, 1
PAUSE 5
PULSOUT E, 1
PULSOUT E, 1
LCDbus = %0010
PULSOUT E, 1
char = %00001100
GOSUB LCD_Command
char = %00000110
GOSUB LCD_Command
Main:
PAUSE 1000
x = x + 1······················ 'Loop counter variable
char = ClrLCD
GOSUB LCD_Command
PAUSE 500
index = Msg
IF x = 5 THEN QUIT······· 'End when x = 5
READ_Char:
READ index, char
IF (char = 0) THEN Main
GOSUB LCD_Write
index = index + 1
GOTO READ_Char
QUIT:
END
LCD_Command:
LOW RS
LCD_Write:
LCDbus = char.HIGHNIB
PULSOUT E, 1
LCDbus = char.LOWNIB
PULSOUT E, 1
HIGH RS
RETURN
Charlie
http://forums.parallax.com/showthread.php?p=609237
http://forums.parallax.com/showthread.php?p=568768
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Mike