TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (385 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139842 times)
  2. FAT32 Library (72209 times)
  3. Network Ethernet Library (57392 times)
  4. USB Device Library (47739 times)
  5. Network WiFi Library (43364 times)
  6. FT800 Library (42700 times)
  7. GSM click (29980 times)
  8. mikroSDK (28440 times)
  9. PID Library (26989 times)
  10. microSD click (26398 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

Color 18 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.2

mikroSDK Library: 2.0.0.0

Category: Optical

Downloaded: 36 times

Not followed.

License: MIT license  

Color 18 Click is a compact add-on board for accurate ambient light detection and flicker monitoring. This board features the TCS3530, a true color ambient light sensor from ams OSRAM. The TCS3530 features true color XYZ sensing, flicker detection up to 7kHz, and eight concurrent sensing channels with independent gain configurations. It also includes a UV/IR blocking filter for precise light measurements and a unique Click Snap feature, allowing the main sensor area to become movable by breaking the PCB for flexible implementation.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Color 18 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Color 18 Click" changes.

Do you want to report abuse regarding "Color 18 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Color 18 Click

Color 18 Click is a compact add-on board for accurate ambient light detection and flicker monitoring. This board features the TCS3530, a true color ambient light sensor from ams OSRAM. The TCS3530 features true color XYZ sensing, flicker detection up to 7kHz, and eight concurrent sensing channels with independent gain configurations. It also includes a UV/IR blocking filter for precise light measurements and a unique Click Snap feature, allowing the main sensor area to become movable by breaking the PCB for flexible implementation.

color18_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Jun 2024.
  • Type : I2C type

Software Support

We provide a library for the Color 18 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 18 Click driver.

Standard key functions :

  • color18_cfg_setup Config Object Initialization function.

    void color18_cfg_setup ( color18_cfg_t *cfg );
  • color18_init Initialization function.

    err_t color18_init ( color18_t *ctx, color18_cfg_t *cfg );
  • color18_default_cfg Click Default Configuration function.

    err_t color18_default_cfg ( color18_t *ctx );

Example key functions :

  • color18_get_int_pin This function returns the INT pin logic state.

    uint8_t color18_get_int_pin ( color18_t *ctx );
  • color18_read_data This function checks if the color measurement data are ready for all channels and reads them.

    err_t color18_read_data ( color18_t *ctx, color18_data_t *data_out );
  • color18_clear_fifo This function clears the FIFO buffers and interrupts.

    err_t color18_clear_fifo ( color18_t *ctx );

Example Description

This example demonstrates the use of Color 18 Click by reading and displaying the values from all 8 modulator channels.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the Click default configuration.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    color18_cfg_t color18_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    color18_cfg_setup( &color18_cfg );
    COLOR18_MAP_MIKROBUS( color18_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == color18_init( &color18, &color18_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( COLOR18_ERROR == color18_default_cfg ( &color18 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
}

Application Task

Waits for a data ready interrupt then reads data from all 8 modulator channels and displays the results on the USB UART every 200ms approximately.

void application_task ( void )
{
    color18_data_t color_data;

    // Wait for a data ready interrupt
    while ( color18_get_int_pin ( &color18 ) );

    if ( COLOR18_OK == color18_read_data ( &color18, &color_data ) )
    {
        log_printf ( &logger, "X: %u\r\n", color_data.x );
        log_printf ( &logger, "Y: %u\r\n", color_data.y );
        log_printf ( &logger, "Z: %u\r\n", color_data.z );
        log_printf ( &logger, "IR: %u\r\n", color_data.ir );
        log_printf ( &logger, "HgL: %u\r\n", color_data.hgl );
        log_printf ( &logger, "HgH: %u\r\n", color_data.hgh );
        log_printf ( &logger, "Clear: %u\r\n", color_data.clear );
        log_printf ( &logger, "Flicker: %u\r\n\n", color_data.flicker );
    }
}

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.Color18

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.


ALSO FROM THIS AUTHOR

RTC 17 Click

0

RTC 17 Click is a compact add-on board that accurately keeps the time of a day. This board features the RV5C387A, a CMOS real-time clock with a built-in interrupt generation function from Nisshinbo Micro Devices Inc, to perform serial transmission of time and calendar data to the MCU. The BU9873 provides information like year, month, day, weekday, hours, minutes, and seconds based on a 32.768kHz quartz crystal through an I2C serial interface to transmit time and calendar data to the MCU. It also has an alarm function that outputs an interrupt signal to the MCU when the day of the week, hour, or minute matches with the preset time.

[Learn More]

Magnetic Rotary 5 Click

0

Magnetic Rotary 5 Click is a compact add-on board for accurate magnet-position sensing. This board features the AS5134, a contactless magnetic rotary encoder from ams AG for accurate angular measurement over a full turn of 360º. It is designed to provide accurate angle measurements with a simple two-pole magnet rotating over the center of the chip, featuring an integrated Hall element, analog front end, and digital signal processing. Offering a high resolution of 8.5 bits, which equates to 360 positions per revolution, it is also capable of high-speed performance, with a maximum RPM of 76875. It can accommodate a wide range of magnetic fields, from 20 to 80mT. It also has an onboard header for incremental and commutation signals of their respective A/B/I and U/V/W signals and pins for Daisy Chain Mode and OTP programming.

[Learn More]

Brushless 17 Click

0

Brushless 17 Click is a compact add-on board suitable for controlling brushless DC (BLDC) motors with any MCU. This board features the L6229Q, DMOS fully integrated three-phase BLDC motor driver with overcurrent protection from STMicroelectronics. This motor driver combines isolated DMOS power transistors with CMOS and bipolar circuits on the same chip, realized in BCD (Bipolar-CMOS-DMOS) multipower technology. It includes all the circuitry for a three-phase BLDC motor drive, including a three-phase DMOS bridge, a constant off-time PWM current controller, and the decoding logic for single-ended hall sensors that generate the required sequence for the power stage.

[Learn More]