color11 2.1.0.0
Main Page

Color 11 click

‍Color 11 Click is a compact add-on board that provides an accurate color-sensing solution. This board features the TCS34083M, an ALS/color sensor with selective flicker detection from ams-OSRAM. The sensor features ambient light and color (RGB) sensing and flicker detection, which suppresses cross-coupling from 940nm IR if generated by adjacent circuits. The main benefits of this sensor are invisible ALS and color sensing under any glass type, unique fast ALS integration mode, and more. It features configurable programmable gain and integration time, tailored ALS and color response, ALS/color interrupt with thresholds, and many more.

click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Sep 2023.
  • Type : I2C type

Software Support

We provide a library for the Color 11 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

‍This library contains API for Color 11 Click driver.

Standard key functions :

Example key functions :

Example Description

‍This library contains API for the Color 11 Click driver. The demo application sets sensor configuration and reads and displays ALS data measurement results.

The demo application is composed of two sections :

Application Init

‍Initialization of I2C module and log UART. After the driver init, the app executes a default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
color11_cfg_t color11_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
color11_cfg_setup( &color11_cfg );
COLOR11_MAP_MIKROBUS( color11_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == color11_init( &color11, &color11_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( COLOR11_ERROR == color11_default_cfg ( &color11 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
log_printf( &logger, " ------------------\r\n" );
Delay_ms ( 100 );
}
@ COLOR11_ERROR
Definition color11.h:290
#define COLOR11_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition color11.h:215
void application_init(void)
Definition main.c:32

Application Task

‍This example demonstrates the use of the Color 11 Click boardâ„¢. Reads and displays the results of the ALS data measurements. Results are being sent to the UART Terminal, where you can track their changes.

void application_task ( void )
{
uint8_t status = 0;
if ( COLOR11_OK == color11_get_data_valid_status( &color11, &status ) )
{
color11_als_data_t color_data;
if ( COLOR11_OK == color11_get_als_data( &color11, &color_data ) && ( COLOR11_STATUS2_AVALID & status ) )
{
log_printf( &logger, " Clear: %u\r\n", color_data.clear );
log_printf( &logger, " Red : %u\r\n", color_data.red );
log_printf( &logger, " Green : %u\r\n", color_data.green );
log_printf( &logger, " Blue : %u\r\n", color_data.blue );
log_printf( &logger, " Wideband : %u\r\n", color_data.wideband );
log_printf( &logger, " Flicker : %u\r\n", color_data.flicker );
log_printf( &logger, " ------------------\r\n" );
Delay_ms ( 1000 );
}
}
}
@ COLOR11_OK
Definition color11.h:289
#define COLOR11_STATUS2_AVALID
Color 11 valid status bit mask.
Definition color11.h:167
void application_task(void)
Definition main.c:70
uint16_t clear
Definition color11.h:262
uint16_t wideband
Definition color11.h:266
uint16_t blue
Definition color11.h:265
uint16_t green
Definition color11.h:264
uint16_t flicker
Definition color11.h:267
uint16_t red
Definition color11.h:263

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Color11

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. UART terminal is available in all MikroElektronika compilers.