-
Notifications
You must be signed in to change notification settings - Fork 5
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
Support for gain and range settings #21
Conversation
The "gain" for the SI1145 is different than many other Lux sensors. While the datasheet labels the settings as "gain", it appears to be implemented as "integration time". A gain of 32 just means the integration time will be 32x the gain 1 setting. The response should be approximately linear. |
@aaronwmorris if you set up pre-commit as described in the guide page here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code you can run the same checks that the actions are doing locally and in the case of code formatting it will resolve it for you automatically. It'll show you any pylint issues locally as well which will also cause the actions to fail. |
@FoamyGuy Thank you for the pointers. I have corrected all of the issues. |
examples/si1145_test_gains.py
Outdated
@@ -0,0 +1,82 @@ | |||
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries | |||
# SPDX-FileCopyrightText: Copyright (c) 2022 Carter Nelson for Adafruit Industries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we only need 1 copyright notice here instead of two.
Since it's a new file that you created now you can also update the year to 2024 and use your name or username instead of these ones.
You can also omit the "for Adafruit Industries" which is intended to indicate development work that was paid for by Adafruit.
@FoamyGuy I have updated the copyright notices. I am hoping everything looks good now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for adding this functionality @aaronwmorris!
I don't have the hardware to test with and it seems to be discontinued now in the adafruit shop.
I added one commit to revert the simpletest back to not using the new gain functionality and to move over a few of the comments from it to the test gain example that was added. I think it's best generally to try to keep the simpletest to be relatively minimal when possible.
Updating https://github.com/adafruit/Adafruit_CircuitPython_SI1145 to 1.2.0 from 1.1.10: > Merge pull request adafruit/Adafruit_CircuitPython_SI1145#21 from aaronwmorris/main Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Updated download stats for the libraries
No description provided.