From 60312b9051fd4e1cdfde99153a3f29daeff3d99e Mon Sep 17 00:00:00 2001 From: Clemens Sutor Date: Wed, 13 Mar 2024 14:24:48 +0100 Subject: [PATCH] Added cheap chinese clone ID as valid device --- library.properties | 2 +- src/SparkFun_APDS9960.cpp | 2 +- src/SparkFun_APDS9960.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/library.properties b/library.properties index d5edc66..b4af5ce 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SparkFun APDS9960 RGB and Gesture Sensor -version=1.4.3 +version=1.4.4 author=SparkFun Electronics maintainer=SparkFun Electronics sentence=Library for the Avago APDS-9960 sensor diff --git a/src/SparkFun_APDS9960.cpp b/src/SparkFun_APDS9960.cpp index 530c1f6..68c1460 100644 --- a/src/SparkFun_APDS9960.cpp +++ b/src/SparkFun_APDS9960.cpp @@ -63,7 +63,7 @@ bool SparkFun_APDS9960::init() if( !wireReadDataByte(APDS9960_ID, id) ) { return false; } - if( !(id == APDS9960_ID_1 || id == APDS9960_ID_2) ) { + if( !(id == APDS9960_ID_1 || id == APDS9960_ID_2 || id == APDS9960_ID_3) ) { return false; } diff --git a/src/SparkFun_APDS9960.h b/src/SparkFun_APDS9960.h index 8266b45..d882705 100644 --- a/src/SparkFun_APDS9960.h +++ b/src/SparkFun_APDS9960.h @@ -33,6 +33,7 @@ /* Acceptable device IDs */ #define APDS9960_ID_1 0xAB #define APDS9960_ID_2 0x9C +#define APDS9960_ID_3 0xA8 // cheap chinese clone of APDS9660 -> Can only handle gains with factor 1x! /* Misc parameters */ #define FIFO_PAUSE_TIME 30 // Wait period (ms) between FIFO reads