adafruit / Adafruit_APDS9960

Arduino drivers for APDS9960 gesture sensor
Other
37 stars 45 forks source link

[FEATURE] Make clones of APDS9960 work too with this library #44

Closed nicknugget closed 12 months ago

nicknugget commented 12 months ago

There are some clones of the APDS9960 out in the wild which use a different device id. Per default the library fails during the device init if the id is not 0xAB like the original one. But some clones use 0xA8 as an id and some others 0x9C.

So improve handling of device ids and make those devices also work with this library.

Added new device ids to Adafruit_APDS9960.h as defines to make handling of these ids easier.

Changed if-statement in Adafruit_APDS9960.cpp -> Adafruit_APDS9960::begin(uint16_t iTimeMS, apds9960AGain_t aGain, uint8_t addr, TwoWire *theWire) to check for those ids.

No known limitations. Should work on every platform.