We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d6116bf + 8f2f24e commit b6a287eCopy full SHA for b6a287e
adafruit_veml7700.py
@@ -186,7 +186,14 @@ class VEML7700:
186
187
def __init__(self, i2c_bus, address=0x10):
188
self.i2c_device = i2cdevice.I2CDevice(i2c_bus, address)
189
- self.light_shutdown = False # Enable the ambient light sensor
+ for _ in range(3):
190
+ try:
191
+ self.light_shutdown = False # Enable the ambient light sensor
192
+ break
193
+ except OSError:
194
+ pass
195
+ else:
196
+ raise RuntimeError("Unable to enable VEML7700 device")
197
198
def integration_time_value(self):
199
"""Integration time value in integer form. Used for calculating ``resolution``."""
0 commit comments