From 67ab2d018e5d012e7d3867f190873a1437cee58d Mon Sep 17 00:00:00 2001 From: Tamas Szabo Date: Sat, 21 Feb 2015 17:05:16 +0100 Subject: [PATCH] Update ds18b20.lua --- lua_modules/ds18b20/ds18b20.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua_modules/ds18b20/ds18b20.lua b/lua_modules/ds18b20/ds18b20.lua index 32c0f4c0..138c10da 100644 --- a/lua_modules/ds18b20/ds18b20.lua +++ b/lua_modules/ds18b20/ds18b20.lua @@ -99,7 +99,7 @@ function readNumber(addr, unit) if (crc == data:byte(9)) then t = (data:byte(1) + data:byte(2) * 256) if (t > 32767) then - t = -(65536 - t) + t = t - 65536 end if(unit == nil or unit == C) then t = t * 625