Commit 67ab2d01 authored by Tamas Szabo's avatar Tamas Szabo
Browse files

Update ds18b20.lua

parent 5a629e42
...@@ -99,7 +99,7 @@ function readNumber(addr, unit) ...@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment