-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lowlight bugfix in getLuminosity(TSL2591_VISIBLE) when there are low … #42
base: master
Are you sure you want to change the base?
Conversation
…light situations, it is possible, that the ir photosiode returns a higher value than the fullspectrum photosiode. if that happens, the calculated result was a low negative numver which results in a high positive number if returned as an uint
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. |
@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 |
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.