Skip to content

Adjust gain values #17

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

Merged
merged 1 commit into from
Feb 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions adafruit_vl6180x.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def read_lux(self, gain):
elif gain == ALS_GAIN_1_25:
lux /= 1.25
elif gain == ALS_GAIN_1_67:
lux /= 1.76
lux /= 1.67
elif gain == ALS_GAIN_2_5:
lux /= 2.5
elif gain == ALS_GAIN_5:
Expand All @@ -159,7 +159,7 @@ def read_lux(self, gain):
elif gain == ALS_GAIN_20:
lux /= 20
elif gain == ALS_GAIN_40:
lux /= 20
lux /= 40
lux *= 100
lux /= 100 # integration time in ms
Comment on lines 163 to 164
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems strange to me. Is that just to enfore float to be returned? Wouldnt then just

Suggested change
lux *= 100
lux /= 100 # integration time in ms
lux /= 1

suffice?

return lux
Expand Down