[an error occurred while processing this directive]
|
Из DataSheet DS18B20,www.dalsemi.com
TEMPERATURE/DATA RELATIONSHIP Table
----------------------------------------
T DIGITAL OUTPUT(Binary) (Hex)
+125°C 0000 0111 1101 0000 07D0h
+85°C* 0000 0101 0101 0000 0550h
+25.0625°C 0000 0001 1001 0001 0191h
+10.125°C 0000 0000 1010 0010 00A2h
+0.5°C 0000 0000 0000 1000 0008h
0°C 0000 0000 0000 0000 0000h
-0.5°C 1111 1111 1111 1000 FFF8h
-10.125°C 1111 1111 0101 1110 FF5Eh
-25.0625°C 1111 1110 0110 1111 FE6Fh
-55°C 1111 1100 1001 0000 FC90h
---------------------------------------
*The power-on reset value of the temperature register is +85°C
Например:
if (dataTMP<0){
dataTMP=-dataTMP;
Temp=-1.0*dataTMP*0.0625;
} else {
Temp=dataTMP*0.0625;
}
E-mail: info@telesys.ru