Color 10 Click Board
Color 10 Click Board
The Color 10 Click Board™ is carrying a VEML3328 sensor for RGB and IR light-sensing as well as the RGB diode incorporated on the board which makes it a good colour detection device when it's combined with a white LED. The VEML3328 sensor senses red, green, blue, clear and IR light by incorporating photodiodes, amplifiers, and analogue/digital circuits into a single CMOS chip.
With this sensor, the brightness and colour temperature of a display backlight can be adjusted based on the ambient light source, and it can differentiate indoor from outdoor lighting environments.
Software Support
We provide a library for the Color 10 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
Library provides functions for reading color registers from device. Converting data to HSL color data, and automatically reading predefined colors;
Key Functions
uint16_t color10_generic_read ( uint8_t cmd_addr );
- Generic read function from devicefloat color10_get_color_value ( void );
- Functions for read HSL color valueuint8_t color10_get_color ( float color_value );
- Functions for detecting colors from HSL value
Example Description
The application is composed of three sections :
- System Initialization - Inicializes I2C module
- Application Initialization - Initialization driver init, checks device ID and sets default configuration
- Application Task - Reads color IR ADC value and then checks for predefined colors with write_color funcion
void application_task ( ) { uint16_t read_data; float color_data; read_data = color10_generic_read( COLOR10_CMD_REG_IR ); WordToStr( read_data, demo_txt ); mikrobus_logWrite( " - IR value: ", _LOG_TEXT ); mikrobus_logWrite( demo_txt, _LOG_LINE ); mikrobus_logWrite( " - Color: ", _LOG_TEXT ); write_color( ); mikrobus_logWrite( " *************** ", _LOG_LINE ); Delay_ms( 1000 ); }
Additional Functions :
- void write_color ( float color_val ) - Reads and gets color HSL value and then checks for the color and logs a few predefined colors
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C
- UART
Additional Notes and Information
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.
MIKROSDK
The Color 10 Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
Color 10 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.