Open smnmsr opened 3 years ago
I'm not sure why the checks have failed. I've double-checked the code again and I cannot see any issue. Furthermore my code is running fine on my installation.
I've changed one more thing
There is an open issue about negative Lux values. Therefore the method first checks if the full value is greater than the ir value and if the full value isn't zero. this should fix that issue.
https://github.com/adafruit/Adafruit_TSL2591_Library/issues/24
@ladyada have you had a chance to look into this yet?
nope! we wouldn't review until there are no merge conflicts and the actions CI passes this guide has hints on how to make sure the library can pass CI! https://learn.adafruit.com/contribute-to-arduino-with-git-and-github
What about now?
in low light situations, it is possible, that the ir photodiode returns a higher value than the fullspectrum photodiode. if that happens, the calculated result was a low negative number which results in a high positive number if returned as an uint.
e.g. if the fullspec diode returns 0 and the ir diode returns 1, the calculated result for the visible value was -1. if -1 is stored in an uint16_t it results as an 0xFFFE.
The Scope of the change is to prevent the getLuminosity(TSL2591_VISIBLE) method to return 0xFFFF or 0xFFFE in low light situations, when the IR diode can return values greater then the ones from the fullspec diode.
Describe any known limitations with your change. There are no known limitations.