We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2020-02-28
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Optical
Downloaded: 2339 times
Not followed.
License: MIT license
Color 10 Click is carrying VEML3328 sensor for RGB and IR light sensing as well as the RGB diode incorporated on the board which makes it good color detection device when its combined with a white LED.
Do you want to subscribe in order to receive notifications regarding "Color 10 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Color 10 click" changes.
Do you want to report abuse regarding "Color 10 click".
Library Description
Library provides functions for reading color registers from device. Converting data to HSL color data, and automaticly 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 valueExamples description
The application is composed of three sections :
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 :
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.