ColorPal Wiring & Code Example

For sensing color, the ColorPAL uses its LED to illuminate a sample, one color component at a time, along with a broad-spectrum light-to-voltage converter to measure the light reflected back. The amount of light reflected from the sample under illumination from each red, green, and blue LED can be used to determine the sample’s color.

 

Wiring & Connections

If using a Propeller Activity Board, the ColorPal can be connected to either the breadboard or via a 3-wire extension cable to one of the servo headers P12-P17.

 

Quick Code Example

Using the connections shown in the wiring diagram above, this example will display the RGB values detected by the ColorPal in the Terminal. Try holding differently-colored objects up to the sensor to see their RGB values.