McMurry
Member level 3
I am having problem to get the decimal value for the temperature output i.e.
in the form of xx.y
to get that y value... i am currently using this formula in MCU program
temp_dec = 9-(((int)get[6]*9)/16)
which i found to be incorrect after it display the value "0.9" when i disconnect the sensor.
has anyone successfully found the "formula" to obtain the decimal value?
ANOTHER QUESTION..
in its datasheet, it is clearly written that ds18s20 has accuracy of +/- 0.5 degree celcius.
does that mean i should just make the output reading to be just an integer value?
Thanks.
in the form of xx.y
to get that y value... i am currently using this formula in MCU program
temp_dec = 9-(((int)get[6]*9)/16)
which i found to be incorrect after it display the value "0.9" when i disconnect the sensor.
has anyone successfully found the "formula" to obtain the decimal value?
ANOTHER QUESTION..
in its datasheet, it is clearly written that ds18s20 has accuracy of +/- 0.5 degree celcius.
does that mean i should just make the output reading to be just an integer value?
Thanks.