I have a single 18B20 temp sensor and read the device using the code below
What I would like to do is detect if the sensor is connected or not, and if it's not present to simply display "N/C" in place of the temperature
Any suggestions
Code:
'Get and display the temperature
GIE = 0
OWOUT DQ, 1, [$CC, $44] ' Start temperature conversion
OWOUT DQ, 1, [$CC, $BE] ' Read the temperature
OWIN DQ, 0, [temperature.LOWBYTE, temperature.HIGHBYTE]
GIE = 1
temperature = temperature */ 1600
lcdout $FE,$D4+0,"TEMP ",dec(temperature / 100),$DF,"C"
Any suggestions