Update ds18b20.lua

This commit is contained in:
Tamas Szabo 2015-02-21 17:05:16 +01:00
parent 5a629e4297
commit 67ab2d018e
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ function readNumber(addr, unit)
if (crc == data:byte(9)) then if (crc == data:byte(9)) then
t = (data:byte(1) + data:byte(2) * 256) t = (data:byte(1) + data:byte(2) * 256)
if (t > 32767) then if (t > 32767) then
t = -(65536 - t) t = t - 65536
end end
if(unit == nil or unit == C) then if(unit == nil or unit == C) then
t = t * 625 t = t * 625