Skip to content

Commit 9977ed5

Browse files
authored
Merge pull request #26 from standsi/SetInitialLightGain
Set initial light gain to lowest
2 parents 380aaa9 + 0cb9ae7 commit 9977ed5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

adafruit_veml7700.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ def __init__(self, i2c_bus: I2C, address: int = 0x10) -> None:
195195
self.i2c_device = i2cdevice.I2CDevice(i2c_bus, address)
196196
for _ in range(3):
197197
try:
198+
# Set lowest gain to keep from overflow on init if bright light
199+
self.light_gain = self.ALS_GAIN_1_8
200+
#
198201
self.light_shutdown = False # Enable the ambient light sensor
199202
break
200203
except OSError:

0 commit comments

Comments
 (0)