Update ds18b20.lua
This commit is contained in:
parent
5a629e4297
commit
67ab2d018e
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue