Skip to content

Commit 1954111

Browse files
committed
move gain set into try - tested with simple example
1 parent d733c33 commit 1954111

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

adafruit_veml7700.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,11 @@ class VEML7700:
193193

194194
def __init__(self, i2c_bus: I2C, address: int = 0x10) -> None:
195195
self.i2c_device = i2cdevice.I2CDevice(i2c_bus, address)
196-
# Set lowest gain to keep from overflow on init if bright light
197-
self.light_gain=self.ALS_GAIN_1_8
198196
for _ in range(3):
199197
try:
198+
# Set lowest gain to keep from overflow on init if bright light
199+
self.light_gain=self.ALS_GAIN_1_8
200+
#
200201
self.light_shutdown = False # Enable the ambient light sensor
201202
break
202203
except OSError:

0 commit comments

Comments
 (0)