color7 2.0.0.0
|
Color 7 click is a very accurate color sensing Click board which features the TCS3472 color light to digital converter with IR filter, from ams.
We provide a library for the Color7 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
This library contains API for Color7 Click driver.
- Initialization function.void color7_cfg_setup ( color7_cfg_t *cfg );
COLOR7_RETVAL color7_init ( color7_t *ctx, color7_cfg_t *cfg );
void color7_default_cfg ( color7_t *ctx );
- Get interrut pin stateuint8_t color7_get_color( color7_t *ctx );
uint8_t color7_get_interrupt_state ( color7_t *ctx );
float color7_read_color_ratio ( color7_t *ctx, uint8_t color );
Demo application reads and detects colors - detected color logs on USBUART.
The demo application is composed of two sections :
Configuring clicks and log objects. Settings the click in the default configuration.
Reads light color and checks which color of light is detected by the sensor If the light color is detected, the detected color message is logged on the USBUART.
Light source must be pointed towards sensor in order for sensor to detect light source color correctly. We used the HSL color palette on the monitor as an example.
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.