adafruit / Adafruit_CircuitPython_APDS9960

Adafruit Bundle driver for APSD9960 Gesture breakout board
MIT License
11 stars 17 forks source link

add different device ID #45

Closed dertobias closed 11 months ago

dertobias commented 11 months ago

RuntimeError Exception prohibits code to proceed. Tested with (apds)GY-9960 board.

FoamyGuy commented 11 months ago

@dertobias could you modify the code to print the value of self._read8(_APDS9960_ID) on your device? It sounds to me like your device is some sort of variation that has a different ID.

I think it would be best if we added a new ID to a list of valid IDs to check rather than removing the logic to check them entirely.

dertobias commented 11 months ago

you're right. it prints 168. So adding it as device_id2 0xa8 worked on my end :)

FoamyGuy commented 11 months ago

@dertobias If you're up to it can you change this PR (or submit a new one) to refactor DEVICE_ID to be a list or tuple and then have the logic use something if self._read8(_APDS9960_ID) not in DEVICE_IDS:

dertobias commented 11 months ago

@FoamyGuy patch works for me :)