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

Auto sensitivity #35

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

Auto sensitivity #35

wants to merge 53 commits into from

Conversation

s-light
Copy link

@s-light s-light commented Jan 20, 2020

This Pull-Request adds a new way of configuration management to the Adafruit_TSL2561 core files.
they enable a advanced & fast configuration setting.

this functionality is used in the slight_TSL2591AutoSensitivity class.
(currently located in the example tsl2591_auto_sensitivity)
This class implements a automatic switching of the configuration to get the full range of light sensitivity the sensor offers.
i think this class gives a big useful addition for the sensor - as you don't have to think about the correct sensitivity range anymore.

additionally i have added a simple average filter.
one more idea is a 'value has changed flag' -
that is aware of the current 'range':
for 0.1..2 Lux it triggers if first first decimal place changes
for 2..10 lux it triggers if first integral digit changes (but does not on fractional changes)
and so on...
this way 'noise' does not trigger...

if Adafruit is willing to merge this, i am happy to rename this class..
if this 'auto sensitivity' is to 'advanced' / not matching for this lib i will split this functionality into my own library.
and would add a advanced example explaining the use of the advanced configuration here.

please let me know what you think of this!

sunny greetings
stefan

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.

1 participant