From the manual, the OWIN command...
If a device is not present, OWIN can jump to an optional Label.
You should be able to just use the Label function of the OWIN command to have your program jump to a routine that displays "N/C"
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], NoDevice
GIE = 1
temperature = temperature */ 1600
lcdout $FE,$D4+0,"TEMP ",dec(temperature / 100),$DF,"C"
NoDevice:
lcdout $FE,$D4+0,"No One Wire Device Detected"
GOTO main
Bookmarks