Code:
Print_To_2nd_Line_Of_Lcd:' ,".",DEC2 Water_Temp,
Sign = TempC.15
TempC = ABS(TempC)
TempC =(TempC>>1)*10 + (TempC.0 * 5)
IF Sign then
IF Its = Dark THEN
IF Temp_Displayed = Fahrenheit then
LCDOut $fe, $c0,1,"H2o = -",DEC Water_Temp / 10,".",DEC2 Water_Temp,0,"F"
ENDIF
IF Temp_Displayed = Celsius then
LCDOut $fe, $c0,1,"H2o = -",DEC Water_Temp / 10,".",DEC2 Water_Temp,0,"C"
ENDIF
ELSE'if its light then show the print below
IF Temp_Displayed = Fahrenheit then
LCDOut $fe, $c0,2,"H2o = -",DEC Water_Temp / 10,".",DEC2 Water_Temp,0,"F"
ENDIF
IF Temp_Displayed = Celsius then
LCDOut $fe, $c0,2,"H2o = -",DEC Water_Temp / 10,".",DEC2 Water_Temp,0,"C"
ENDIF
ENDIF
ELSE
IF Its = Dark THEN
IF Temp_Displayed = Fahrenheit then
LCDOut $fe, $c0,1,"H2o=",DEC Water_Temp / 100,".",DEC2 Water_Temp,0, _
"F ",DEC Lite_Level
ENDIF
IF Temp_Displayed = Celsius then
LCDOut $fe, $c0,1,"H2o=",DEC Water_Temp / 100,".",DEC2 Water_Temp,0, _
"C ",DEC Lite_Level
ENDIF
ELSE'if its light then show the print below
IF Temp_Displayed = Fahrenheit then
LCDOut $fe, $c0,2,"H2o=",DEC Water_Temp / 100,".",DEC2 Water_Temp,0, _
"F ",DEC Lite_Level
ENDIF
IF Temp_Displayed = Celsius then
LCDOut $fe, $c0,2,"H2o=",DEC Water_Temp / 100,".",DEC2 Water_Temp,0, _
"C ",DEC Lite_Level
ENDIF
ENDIF
ENDIF
RETURN
This is how I read the temperature:
Code:
Update_Pond_Temperature:
OWOut Sensor_Input, 1, [$CC, $44] ' Start Water_Temp conversion
waitloop:
OWIn Sensor_Input, 4, [count_remain] ' Check for still busy converting
IF count_remain = 0 THEN waitloop
OWOut Sensor_Input, 1, [$CC, $BE] ' Read the Water_Temp
OWIn Sensor_Input, 0, [Water_Temp.LOWBYTE, Water_Temp.HIGHBYTE, _
Skip 4, count_remain, count_per_c]
' Calculate Water_Temp in degrees C to 2 decimal places
Water_Temp = (((Water_Temp >> 1) * 100) - 25) _
+ (((count_per_c - count_remain) * 100) / count_per_c)
IF Temp_Displayed = Celsius then RETURN
'IF the Temp_Displayed = Fahrenheit then Convert C to F before returning
Water_Temp = (Water_Temp */ 461) + 3200
RETURN
When the temperature drops below 32 degrees F then it displays 556 instead of 31. I'd surely appreciate any further help you could provide.
Bookmarks