diff --git a/fs/ds18b20.js b/fs/ds18b20.js index 9e16fc5..ccf3810 100644 --- a/fs/ds18b20.js +++ b/fs/ds18b20.js @@ -71,6 +71,10 @@ function getTemp(ow, rom) { raw = raw & ~1; } // Default resolution is 12 bit + // + if ((raw & 0x8000) > 0) { + raw = raw - 0x10000; + } return raw / 16.0; };