color2
2.0.0.0
|
Color 2 Click carries the ISL29125 RGB color light sensor. It detects red, green and blue in a variety of lighting conditions, outputting 16-bit resolution data in a measuring range from 5.7 m lux to 10,000 lux.
We provide a library for the Color2 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 Color2 Click driver.
color2_cfg_setup
Config Object Initialization function. color2_init
Initialization function. color2_default_cfg
Click Default Configuration function. color2_read_rgb
Function read red, green, and blue data from ISL29125 color2_rgb_to_hsl
This function converts RGB (red, green, blue) to HSL (hue, saturation, lightness) color value. color2_get_color
This function returns the color name flag from the input HSL color. This example demonstrates the use of Color 2 Click board by reading data
from RGB channels and converting them to HSL color and displaying those data as well as the detected color name on the USB UART.
The demo application is composed of two sections :
Initializes the driver and performs the Click default configuration.
Waits for the data ready interrupt, then reads the values of all channels and converts
them to HSL color and displays those data as well as the detected color name on the USB UART every 100ms approximately.
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.