Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

smnmsr
Copy link
Contributor

@smnmsr smnmsr commented Feb 12, 2021

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.

  • Please run any tests or examples that can exercise your modified code. The code is running fine within an installation of the tsl2591

smnmsr and others added 2 commits February 12, 2021 21:46
…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
@smnmsr
Copy link
Contributor Author

smnmsr commented Feb 12, 2021

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.

@smnmsr
Copy link
Contributor Author

smnmsr commented Feb 12, 2021

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.

#24

@smnmsr
Copy link
Contributor Author

smnmsr commented Feb 18, 2021

@ladyada have you had a chance to look into this yet?

@ladyada
Copy link
Member

ladyada commented Feb 18, 2021

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

@smnmsr
Copy link
Contributor Author

smnmsr commented Mar 2, 2021

What about now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants