Go Down

Topic: Need Help with colour sensor module coding (TCS3200) (Read 775 times) previous topic - next topic


I have recently purchased a tcs3200 colour sensor module for Arduino and would like to design a code to detect only two colours, either blue or red. So it simply has to output the colour of the object or light up either of the colour leds connected seperately to the arduino (blue or red) after the object has been placed in front of the detector. I have looked at similar coding but they all seem to complex and don't really give the output I need. So just to put it down in point form as to what the code should do:
-Pins S0 and S1 will be connected to VCC always since I want it to operate at maximum frequency.
-The code should output the colour of the object placed in front of the detector which is either red or blue, any other colour doesnt matter and can be assigned a seperate output. Alternatively rather than display the output it can light up an LED corresponding to either colour which are pinned to Arduino.

Any help would be much appreciated


Aug 24, 2014, 01:48 am Last Edit: Aug 24, 2014, 01:52 am by marco_c Reason: 1
My code repository has a library for this device. Of interest for you might be the documentation with the library on how to use and calibrate the device.  Link below in the signature block.

What you want to do is in your software, not inherent in the way the sensor works. The sensor will return the rgb value of the color it sees. If all you want are the r and b vales, just use those. Your software will need to decide how you handle colors like purple that present a red and blue reading, for example.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Go Up