SainSmart Color Recognition Sensor input/single RGB LED Output

Hi everyone,

I have recently purchased the SainSmart Color Recognition/Discrimination Sensor TCS3200D/TCS230D and am trying to use it as an input for a single RGB LED. Unfortunately I have no idea how to do this. I have the Arduino UNO Rev3.

Any help will be MUCH appreciated!

Also, I guess I'm not sure if I can use regular RGB LED lights or if I need SMD RGB LEDs.

For the first part you could try using my TCS230 library. The link to all my libraries is in the signature block. There is PDF documentation that tells you how to use and calibrate the sensor.

For the second part your RGB LED will need to be connected to the PWM Arduino pins. You will need to translate the RGB values (0-65535) into PWM signals (0-255) by scaling before you output the same color to the RGB LED.

I am trying to use the sensor above with the following code but am getting a series of error messages. Can anyone take a look at the code and tell me how to fix them? Would be much appreciated.

chameleon_code.ino (3.05 KB)

marco_c: For the first part you could try using my TCS230 library. The link to all my libraries is in the signature block. There is PDF documentation that tells you how to use and calibrate the sensor.

For the second part your RGB LED will need to be connected to the PWM Arduino pins. You will need to translate the RGB values (0-65535) into PWM signals (0-255) by scaling before you output the same color to the RGB LED.

Okay, thanks for your help. I found another tutorial online about using RGB LEDs at varying brightnesses which uses the PWM pins in the code, so I have hooked up the LEDs according to their directions. As for the sensor, I found another tutorial online but the code has errors that I don't know how to fix. Definitely will need your PDF file to calibrate the sensor when I get this thing running, though.

According to the instructions, I downloaded the “metro library”, found here: http://playground.arduino.cc/code/metro#.UylIrvmSySo

I think the library might be the problem but I don’t know how to correct it.