Closed mvn23 closed 5 years ago
@ladyada looks ok, but not sure as don't have this chip
k yeah this chip was discontinued but you can get breakouts on ebay and such
Without this patch I got readings of 262143 (2^18 - 1) lux every once in a while, especially in low light conditions. I traced it back to these few lines and haven't seen any occurences since applying the fix. The TSL2561 is on a breakout board connected to a Wemos D1 mini.
got this chip now, works fine with this patch :)
Rewrite negative lux value check to avoid comparing unsigned long < 0. Modifies Adafruit_TSL2561_U.cpp.
Prevents returning unrealistic lux values when
(channel0 * b) < (channel1 * m)