Hello all again. I just have a newbie question here. I am using the 18b20 dallas one wire and all is well except one thing. I am trying to cause a port pin to high at 40 degrees f. In celcius this is 4.444444444444 you get the idea. The binary string is something like this:
0000 0000 0100 0111 which is about 4.4375 degrees celcius which is close enough. This is the code I am using which is complements of Reynolds Electronics:
OWIN D, 4, [Stat]' Check for still busy converting
IF Stat = 0 THEN W1' Still busy?, then loop
OWOUT D, 1,[$55,$28,$7A,$4A,$66,$00,$00,$00,$84,$BE]
OWIN D, 2, [Temp.LOWBYTE,Temp.HIGHBYTE]' Read two bytes, then end communications
IF Temp.bit15 = 1 THEN Below_32 ' Check for temp below 0°C
Sign = "+"
Temp = ((((Temp >> 4) + 50) * 9) /5) -58
LCDout $fe,$94,"Temp #1 =","+", DEC Temp,".", DEC2 Temp,"F"
I am just unsure how to mess with the code necessary for the temp conversion with a 16 bit binary number. I read a couple of strings that are close to what I needed but I couldn't get them to work. I appreciate any help.
Travin
Bookmarks