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 669c6d8 + f108c4e commit 40dc452Copy full SHA for 40dc452
adafruit_vl6180x.py
@@ -27,7 +27,7 @@
27
"""
28
from micropython import const
29
30
-import adafruit_bus_device.i2c_device as i2c_device
+from adafruit_bus_device import i2c_device
31
32
33
__version__ = "0.0.0-auto.0"
@@ -129,8 +129,7 @@ def read_lux(self, gain):
129
self._write_8(_VL6180X_REG_SYSALS_INTEGRATION_PERIOD_HI, 0)
130
self._write_8(_VL6180X_REG_SYSALS_INTEGRATION_PERIOD_LO, 100)
131
# analog gain
132
- if gain > ALS_GAIN_40:
133
- gain = ALS_GAIN_40
+ gain = min(gain, ALS_GAIN_40)
134
self._write_8(_VL6180X_REG_SYSALS_ANALOGUE_GAIN, 0x40 | gain)
135
# start ALS
136
self._write_8(_VL6180X_REG_SYSALS_START, 0x1)
0 commit comments