Best Answer CW2, 22 April 2013 - 07:05 PM
I am not sure how many ohms the one I am using at the moment is, as I am a new to all of this and have only what came in my starter kit.
The recommended value of the pull-up resistor is 4.7 k?.
I am using the same code that Brad used in his blog post here (http://bradsduino.bl...vices-with.html) with just a slight modification to output the serial number along with the temp.
The original code does not handle negative temperatures, it produces incorrect results. The formula for calculating temperature in degrees Celsius from the two bytes obtained from the sensor is
var tempLo = oneWire.ReadByte();var tempHi = oneWire.ReadByte();var temperatureCelsius = ((short)((tempHi << 8) | tempLo))/16F;
Using short instead of ushort, so the sign is preserved.
Go to the full post