From 933043ba776328307d511f8d96ab1e0962b483a5 Mon Sep 17 00:00:00 2001 From: CzechUavGuy Date: Mon, 20 Mar 2017 21:33:25 +0100 Subject: [PATCH] Fixed scaling factors (#1284) Should be scaled by 2^10 bot by 2^16. See datasheet https://cdn-shop.adafruit.com/datasheets/TSL2561.pdf page 24 --- lib/light.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/light.js b/lib/light.js index 7d42b960d..ac343139b 100644 --- a/lib/light.js +++ b/lib/light.js @@ -327,8 +327,8 @@ var Controllers = { // Page 27 // CalculateLux(...) - ch0 = (ch0 * scale) >> 0x10; - ch1 = (ch1 * scale) >> 0x10; + ch0 = (ch0 * scale) >> 10; + ch1 = (ch1 * scale) >> 10; var ratio1 = 0;