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

Set initial light gain to lowest #26

Merged
merged 4 commits into from
Feb 26, 2024
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
3 changes: 3 additions & 0 deletions adafruit_veml7700.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ def __init__(self, i2c_bus: I2C, address: int = 0x10) -> None:
self.i2c_device = i2cdevice.I2CDevice(i2c_bus, address)
for _ in range(3):
try:
# Set lowest gain to keep from overflow on init if bright light
self.light_gain = self.ALS_GAIN_1_8
#
self.light_shutdown = False # Enable the ambient light sensor
break
except OSError:
Expand Down