COLOR is color recognition unit integrated with TCS3472 chipset. As the name says, COLOR is able to detect color value and return RGB data as response.
Identify color principle: The TCS3472 chipset integrated with 3*4 array of filtered photodiodes and a 16 bit analog-to-digital embedded converters. Out of the 12 photodiodes, 3 have red filters, 3 have green filters, 3 have blue filters and 3 have no filter (clear), which gives a total range of RGBA (RGB + Transparency)
When detecting the color of an object the TCS3472 returns data from four channels: red(R), green(G), blue(B) and clear(C)(non-filtered). The response from the red, green and blue channels (RGB) can be used to determine a particular source’s chromaticity coordinates (x, y).
Chromaticity Calculation Process Overview:
When we get coordinates (x, y), please reference the below figure so as to get the recommended color.
This Unit communicates with the M5Core via the GROVE A interface(I2C). Address is 0x29.
EasyLoader is a concise and fast program writer, which has a built-in case program related to the product. It can be burned to the main control by simple steps to perform a series of function verification.
The sensor collects the current CRGB value and prints it out through the serial port.
The code below is incomplete. To get the complete code, please click here
After burning this example firmware, PC serial terminal will print original value RGBC (red, green, blue, clear).
Identify colors and return RGB values
Get rawData Return original data
Get red Return red value
Get green Return green value
Get blue Return blue value