From 2eab3c9f52751b0fc2e47e181186de9042dab6eb Mon Sep 17 00:00:00 2001 From: "John M. Knutson Sr" Date: Sun, 13 Dec 2020 14:27:30 -0600 Subject: [PATCH] subzero temp fix --- fs/ds18b20.js | 4 ++++ 1 file changed, 4 insertions(+) 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; };