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

Support for gain and range settings #21

Merged
merged 12 commits into from
Sep 21, 2024
Merged

Conversation

aaronwmorris
Copy link
Contributor

No description provided.

@aaronwmorris
Copy link
Contributor Author

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.

@FoamyGuy
Copy link
Contributor

FoamyGuy commented Sep 9, 2024

@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.

@aaronwmorris
Copy link
Contributor Author

@FoamyGuy Thank you for the pointers. I have corrected all of the issues.

@@ -0,0 +1,82 @@
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2022 Carter Nelson for Adafruit Industries
Copy link
Contributor

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.

@aaronwmorris
Copy link
Contributor Author

@FoamyGuy I have updated the copyright notices. I am hoping everything looks good now.

Copy link
Contributor

@FoamyGuy FoamyGuy left a 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.

@FoamyGuy FoamyGuy merged commit 52b15f1 into adafruit:main Sep 21, 2024
1 check passed
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Sep 22, 2024
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