TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 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 (139250 times)
  2. FAT32 Library (71747 times)
  3. Network Ethernet Library (57120 times)
  4. USB Device Library (47430 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42403 times)
  7. GSM click (29835 times)
  8. mikroSDK (28074 times)
  9. PID Library (26885 times)
  10. microSD click (26198 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 17 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.7

mikroSDK Library: 2.0.0.0

Category: Optical

Downloaded: 128 times

Not followed.

License: MIT license  

Color 17 Click is a compact add-on board representing an accurate color-sensing solution. This board features the OPT4048, a high-speed precision tristimulus XYZ color sensor from Texas Instruments. The sensor has four sensing channels and uses precision optical filters to mimic the normal vision of the human eye. The OPT4048 also has 12 configurable conversion times that range from 600μs up to 800ms, with measurements that can be read synchronously or asynchronously. It is not excessively sensitive to micro-shadows and the small particles on the optical surface.

No Abuse Reported

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

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

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

  • Information
  • Comments (0)

mikroSDK Library Blog


Color 17 Click

Color 17 Click is a compact add-on board representing an accurate color-sensing solution. This board features the OPT4048, a high-speed precision tristimulus XYZ color sensor from Texas Instruments. The sensor has four sensing channels and uses precision optical filters to mimic the normal vision of the human eye. The OPT4048 also has 12 configurable conversion times that range from 600μs up to 800ms, with measurements that can be read synchronously or asynchronously. It is not excessively sensitive to micro-shadows and the small particles on the optical surface.

color17_click.png

Click Product page


Click library

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

Software Support

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

Standard key functions :

  • color17_cfg_setup Config Object Initialization function.

    void color17_cfg_setup ( color17_cfg_t *cfg );
  • color17_init Initialization function.

    err_t color17_init ( color17_t *ctx, color17_cfg_t *cfg );
  • color17_default_cfg Click Default Configuration function.

    err_t color17_default_cfg ( color17_t *ctx );

Example key functions :

  • color17_get_cct Color 17 gets correlated color temperature data function.

    err_t color17_get_cct ( color17_t *ctx, float *cct, float *light_intensity );
  • color17_get_measurement Color 17 gets light and color measurement data function.

    err_t color17_get_measurement ( color17_t *ctx, uint32_t *adc_codes );
  • color17_set_config Color 17 set the configuration function.

    err_t color17_set_config ( color17_t *ctx, color17_config_t config );

Example Description

This library contains API for the Color 17 Click driver. This example displays CCT data, Light intensity level and the light color names.

The demo application is composed of two sections :

Application Init

Initialization of I2C module and log UART. After driver initialization, default settings turn on the device.

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    color17_cfg_t color17_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.
    color17_cfg_setup( &color17_cfg );
    COLOR17_MAP_MIKROBUS( color17_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == color17_init( &color17, &color17_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( COLOR17_ERROR == color17_default_cfg ( &color17 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

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

Application Task

This example demonstrates the use of the Color 17 Click board™. Reads and displays the correlated color temperature and Light intensity level. This example also detects and displays the light color names. Results are being sent to the UART Terminal, where you can track their changes.

void application_task ( void ) 
{
    if ( COLOR17_OK == color17_get_cct( &color17, &cct, &light_intensity ) )
    {
        log_printf( &logger, " CCT: %.2f\r\n", cct );
        log_printf( &logger, " LIL: %.2f\r\n", light_intensity );
        log_printf( &logger, " - - - - - - -  - - - - \r\n" );
        color17_display_color( );
    }
    log_printf( &logger, " ----------------------\r\n" );
    Delay_ms ( 1000 );
}

Note

Color detection is obtained based on the analysis of calculate the correlated color temperature (CCT) data and the CIE 1931 chromaticity diagram. For more details please refer to the “OPT4048 High Speed High Precision Tristimulus XYZ Color Sensor datasheet” OPT4048 datasheet.

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

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

ECG 2 click

0

Track the patterns of your beating heart with ECG 2 click. ECG 2 click contains ADS1194 16-bit delta-sigma analog-to-digital converters from Texas Instruments, a built-in programmable gain amplifier (PGA), an internal reference, and an onboard oscillator.

[Learn More]

Angle 10 Click

0

Angle 10 Click is a compact add-on board that detects the absolute angular position of a permanent magnet. This board features the AS5070A, a high-resolution angular position sensor with an analog output for precise absolute angle measurement from ams AG. Based on a Hall sensor technology, the AS5070A measures the orthogonal component of the flux density over a full-turn rotation and compensates for external stray magnetic fields with a robust architecture based on a 14-bit sensor array and analog front-end. Only a simple two-pole magnet rotating over the center of the AS5070A is required to measure the angle, providing an instant indication of the magnet’s angular position.

[Learn More]

Joystick click

0

Simple demonstration of using AS5013 chip. If joystick is moved, cross will move on GLCD folowing joystick's move. When joystick is pressed frame around cross will appear. Example demonstrates writing and reading from AS5013 chip.

[Learn More]