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 (139242 times)
  2. FAT32 Library (71742 times)
  3. Network Ethernet Library (57115 times)
  4. USB Device Library (47428 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42403 times)
  7. GSM click (29835 times)
  8. mikroSDK (28072 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

RGB Ring Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.2

mikroSDK Library: 2.0.0.0

Category: LED matrix

Downloaded: 20 times

Not followed.

License: MIT license  

RGB Ring Click is a compact add-on board designed for dynamic and colorful lighting applications. This board features eight RGB LEDs (WL-ICLED 1312020030000) from Würth Elektronik, incorporating integrated circuits to control color mixing precisely. This board supports individual control of each LED's red, green, and blue components with single-wire communication enabling daisy-chaining. It also features the innovative Click Snap function, allowing the main LED area to be detached for flexible use, and includes a button for interactive functionality.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "RGB Ring Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "RGB Ring Click" changes.

Do you want to report abuse regarding "RGB Ring Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


RGB Ring Click

RGB Ring Click is a compact add-on board designed for dynamic and colorful lighting applications. This board features eight RGB LEDs (WL-ICLED 1312020030000) from Würth Elektronik, incorporating integrated circuits to control color mixing precisely. This board supports individual control of each LED's red, green, and blue components with single-wire communication enabling daisy-chaining. It also features the innovative Click Snap function, allowing the main LED area to be detached for flexible use, and includes a button for interactive functionality.

rgbring_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Aug 2024.
  • Type : GPIO type

Software Support

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

Standard key functions :

  • rgbring_cfg_setup Config Object Initialization function.

    void rgbring_cfg_setup ( rgbring_cfg_t *cfg );
  • rgbring_init Initialization function.

    err_t rgbring_init ( rgbring_t *ctx, rgbring_logic_t logic_zero, rgbring_logic_t logic_one, rgbring_cfg_t *cfg );
  • rgbring_default_cfg Click Default Configuration function.

    err_t rgbring_default_cfg ( rgbring_t *ctx );

Example key functions :

  • rgbring_get_int_pin This function returns the INT pin logic state.

    uint8_t rgbring_get_int_pin ( rgbring_t *ctx );
  • rgbring_set_led_color This function sets the color of the selected LED in the LED matrix.

    void rgbring_set_led_color ( rgbring_t *ctx, uint8_t led_num, uint32_t rgb );
  • rgbring_write_led_matrix This function writes the LED matrix data from the Click context object.

    err_t rgbring_write_led_matrix ( rgbring_t *ctx );

Example Description

This example demonstrates the use of RGB Ring Click board by controling an RGB ring by cycling through a set of predefined colors. Each color is displayed by lighting up the LEDs in sequence around the ring. After the last LED is lit, the code waits for a button press before moving on to the next color in the sequence. The button press triggers the transition to the next color in the array.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the Click default configuration which sets the color to black (all LEDs off).


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    rgbring_cfg_t rgbring_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.
    rgbring_cfg_setup( &rgbring_cfg );
    RGBRING_MAP_MIKROBUS( rgbring_cfg, MIKROBUS_1 );
    if ( DIGITAL_OUT_UNSUPPORTED_PIN == 
         rgbring_init( &rgbring, &rgbring_logic_zero, &rgbring_logic_one, &rgbring_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( RGBRING_ERROR == rgbring_default_cfg ( &rgbring ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

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

Application Task

Controls an LED ring by cycling through colors and waits for user input to change the ring's color. The button press is required to move to the next color in the sequence. The current color's name and RGB value are logged to the USB UART.

void application_task ( void )
{
    static uint32_t color_num = 0;
    static int8_t led_cnt = 0;

    log_printf( &logger, " Color: %s [%.6LX]\r\n", color[ color_num ].name, color[ color_num ].rgb );
    Delay_ms ( 100 );
    for ( led_cnt = RGBRING_LED_7; led_cnt >= RGBRING_LED_0; led_cnt-- )
    {
        rgbring_set_led_color ( &rgbring, led_cnt, color[ color_num ].rgb );
        rgbring_write_led_matrix ( &rgbring );
        Delay_ms ( 100 );
    }
    if ( ++color_num >= RGBRING_NUM_COLORS )
    {
        color_num = 0;
    }

    log_printf ( &logger, " Press button to change ring color\r\n\n" );
    while ( RGBRING_BUTTON_RELESED == rgbring_get_int_pin ( &rgbring ) );
}

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

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

AD-SWIO 3 Click

0

AD-SWIO 3 Click is a compact add-on board representing a software configurable input/output solution for various purposes. This board features the AD74115H, a single-channel, software-configurable input and output with HART mode from Analog Devices. It provides many functionality for analog input, analog output, digital input, digital output, 2-wire, 3-wire, and 4-wire resistance temperature detector (RTD), and thermocouple measurement capability. The supply power and isolation part are managed by the ADP1034, a 3-channel isolated micropower management unit with seven digital isolators and programmable power control, also from Analog Devices.

[Learn More]

BUZZ click

0

A simple example which demonstrates working withBUZZ click board in mikroBUS form factor.

[Learn More]

DAC 15 Click

0

DAC 15 Click is a compact add-on board that provides a highly accurate digital-to-analog conversion on two channels. This board features the DAC80502, a dual 16-bit 1-LSB INL voltage-output DAC from Texas Instruments. The DAC operates at a wide power supply range and is a low-power device with as low as 1mA per channel at 5.5V. It also includes a 2.5V, 5-ppm/°C internal reference, giving a full-scale voltage buffered output ranges of 1.25V, 2.5V, and 5.5V.

[Learn More]