'test for a minus tempr
If sign.7 = 1 Then 'its a minus tempr
tempr.HB = sign
tempr.LB = temp
tempr = tempr Xor 0xffff 'convert 2s complement to binary
tempr = tempr + 1
neg = "-"
Else
tempr.HB = sign
tempr.LB = temp
neg = "+"
Endif
sign = sign And 0x07 'mask out the 5 sign 1's
tempr = (tempr * 25) / 4 'adjust binary value of DS18B20 to actual tempr
'convert binary tempr to ASCII value for display
b2avall = tempr.LB
b2avalm = tempr.HB
Gosub bin2asc
'display DS18S20 tempr
Lcdcmdout LcdLine1Home
Lcdout "C", 0dfh, "=" neg, ascbfr4, ascbfr3, ascbfr2, ".", ascbfr1, ascbfr0, " "
Goto main