writing to the lcd...
freek
Posts: 22
I'm trying to modify the·lcd demo program that came w/ the stampworks kit and the ds1620 code here: http://www.emesystems.com/OL2d1620.htm,·to display the temp on the lcd.· i understand how to write from eeprom, but can't get it to write directly to the lcd. i have a BS2, and the stampworks board.
i can get the temp out as a signed decimal (+/-###.##), i figured i would do somthing like a this (psudeo code):
what i can't figure out is how to read whole and decimal into the temperature array.
can i do temperature(index)= whole.byte(abs(index-3)) and temperature(index)=whole.byte(abs(index-7))? so the above temp of 20.33 if hard coded would be:
does this make sense...?
Will
i can get the temp out as a signed decimal (+/-###.##), i figured i would do somthing like a this (psudeo code):
char VAR Byte ' character sent to LCD index VAR Byte ' loop counter temp VAR byte(9) 'temperature (20.33) degC VAR Word 'temp from ds1620 whole VAR Word '=degC/100 decimal VAR Word '=degC temperature= temp from ds1620 + "8" 'temperature (20.33*) ReadTemp: char=tmperature(index) IF (char = "*") THEN Msg_Done ' if *, message is complete GOSUB LCD_Write ' write the character index = index + 1 ' point to next character GOTO ReadTemp
what i can't figure out is how to read whole and decimal into the temperature array.
can i do temperature(index)= whole.byte(abs(index-3)) and temperature(index)=whole.byte(abs(index-7))? so the above temp of 20.33 if hard coded would be:
temperature(0) = whole.byte(3) '0 padding temperature(1) = whole.byte(2) '0 could be 120 degrees temperature(3) = whole.byte(1) '2 temperature(4) = whole.byte(0) '0 temperature(5) = %2E 'dec point temperature(6) = decimal.byte(1) '3 temperature(7) = decimal.byte(0) '3 temperature(8) = %2A '*
does this make sense...?
Will
Comments
I will post some stuff later.
Will
posted code will output temp to the lcd.· the problem i'm having is the formating.· the lcd will read 0025.68 when the temp is 25.68.· i'm trying to get rid of the leading zeros.
any thoughts...?
Will
but it works nicly.· also added the negitive bit, doubt i'll see that either, but this could serve others.
thanks,
Will