Sensor is on P0. I have a 4.7k resistor (see pic below).
I changed my code and as soon as it hits OWOUT it jumps above the main label and starts at skipme = 1
I also commented out the first OWOUT in the code but when it hit the second the same thing happened. Then I commented both of them out and it hung on the OWIN until it must have hit a timeout and then it moved forward but the value in the buffer was zero.
[code]temp var word
convert var long
skipme var long
skipme = 1
main
Pause 1000
SEROUT s_out, I4800, “line 7”, 10, 13]
if skipme = 1 then
owout P0,1,continue01,$CC,$44]
skipme = 2
endif
continue01
SEROUT s_out, I4800, “line 9”, 10, 13]
Pause 1000
owout P0,1,continue02,$CC,$BE]
continue02
SEROUT s_out, I4800, “line 13”, 10, 13]
temp = temp >> 4
owin P0,0,[temp.byte0,temp.byte1]
convert = (temp * 10) / 2
SEROUT s_out, I4800, “Temperature = “,real convert,” C”,13]
goto main [/code]
I specifically bought these temp sensors because the manual had the sample code. I thought this one was going to be a piece of cake!
Below is a picture of the sensor on the right with the 4.7k pull-up resistor. The project on the left is another temp sensor I can’t get working!
http://www.otherrobots.com/lynxmotion/DS18B20TempSensor.jpg