Skip to content

Commit

Permalink
Merge pull request #26 from standsi/SetInitialLightGain
Browse files Browse the repository at this point in the history
Set initial light gain to lowest
  • Loading branch information
FoamyGuy committed Feb 26, 2024
2 parents 380aaa9 + 0cb9ae7 commit 9977ed5
Showing 1 changed file with 3 additions and 0 deletions.
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

0 comments on commit 9977ed5

Please sign in to comment.