Adafruit_APDS9960 icon indicating copy to clipboard operation
Adafruit_APDS9960 copied to clipboard

I have problems with RGB reader value and with de calculate LUX and Color temperature.

Open sebadc opened this issue 6 years ago • 2 comments

Hi Guys. I am working whit an APDS-9960, I am try obtain the LUX and Color temperature with Adafruit library, but the result that I obtein is not real. If I read with a luxmeter the result is very diferent, Do you have any Examples with tested code?

My test code is: #include "Adafruit_APDS9960.h" Adafruit_APDS9960 apds;

void setup() { Serial.begin(115200);

if(!apds.begin()){ Serial.println("failed to initialize device! Please check your wiring."); } else Serial.println("Device initialized!"); //enable color sensign mode apds.enableColor(true); }

void loop() { //create some variables to store the color data in uint16_t r, g, b, c; //wait for color data to be ready while(!apds.colorDataReady()){ delay(5); } //get the data and print the different channels apds.getColorData(&r, &g, &b, &c); Serial.print("red: "); Serial.print(r); Serial.print(" green: "); Serial.print(g); Serial.print(" blue: "); Serial.print(b); Serial.print(" clear: "); Serial.println(c); Serial.println(); float luz=apds.calculateLux(r,g,b); float color=apds.calculateColorTemperature(r,g,b); Serial.print (" LUXES: "); Serial.println (luz); Serial.print (" Color: "); Serial.println (color); delay(500); } Regards. Seba

sebadc avatar Aug 03 '18 12:08 sebadc