The TCS230 is a color light-to-frequency converter on single CMOS integrated circuit. The output is a square wave(50% duty cycle) with frequency directly proportional to light intensity (irradiance). The full-scale output frequency can be scaled by one of three preset values via two control input pins. Output enable (OE) places the output in the high-impedance state for multiple-unit sharing of a icrocontroller input.
I recently acquired one of these sensors and was surprised at not being able to find a good library, and explanation for how to use the sensor, so I wrote one. The library is available at the link in my signature below). This library has a dependency on the FreqCount library for frequency counting (included in the download).
Library example code includes:
- Simple blcking read from the sensor
- Simple RGB non-blocking read
- Example incorporating sensor calibration
- Color learning and matching
As usual an questions, comments and suggestions for improvement are welcome.