Skip to content

Commit 88d730c

Browse files
authored
Update apds9960.py
Changed IDs to tuple and added new chip ID
1 parent d907d45 commit 88d730c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_apds9960/apds9960.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
# Only one address is possible for the APDS9960, no alternates are available
5353
_APDS9960_I2C_ADDRESS = const(0x39)
54-
_DEVICE_ID = const(0xAB)
54+
_DEVICE_IDS = (const(0xAB), const(0xA8))
5555

5656
# APDS9960_RAM = const(0x00)
5757
_APDS9960_ENABLE = const(0x80)
@@ -183,8 +183,8 @@ def __init__(
183183

184184
self.i2c_device = I2CDevice(i2c, _APDS9960_I2C_ADDRESS)
185185

186-
#if self._read8(_APDS9960_ID) != _DEVICE_ID:
187-
# raise RuntimeError()
186+
if self._read8(_APDS9960_ID) not in _DEVICE_IDS:
187+
raise RuntimeError()
188188

189189
if reset:
190190
# Disable prox, gesture, and color engines

0 commit comments

Comments
 (0)