How does it work?
2×4 RGB Click is based on an array of 2×4 RGB LEDs (WL-ICLED 1312121320437) from Würth Elektronik, specially designed for dynamic and colorful lighting applications. These LEDs incorporate an integrated circuit (IC), often called addressable or smart LEDs, allowing for individual control of each diode’s red, green, and blue components through pulse width modulation (PWM). This enables precise control over color mixing, creating a broad spectrum of color outputs. To ensure compatibility with both 3.3V and 5V logic systems, the Click board™ features the LSF0102 voltage translator, which provides seamless control of the LEDs regardless of the MCU’s logic level, ensuring reliable performance in various system configurations.
2×4 RGB Click is designed in a unique format supporting the newly introduced MIKROE feature called “Click Snap.” Unlike the standardized version of Click boards, this feature allows the main IC area to become movable by breaking the PCB, opening up many new possibilities for implementation. Thanks to the Snap feature, the 1312121320437s can operate autonomously by accessing its signals directly on the pins marked 1-8. Additionally, the Snap part includes a specified and fixed screw hole position, enabling users to secure the Snap board in their desired location, and an unpopulated header labeled J1 at the top, allowing for daisy-chaining and control of multiple Snap units in a series.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.
Click Snap
Click Snap is an innovative feature of our standardized Click add-on boards, introducing a new level of flexibility and ease of use. This feature allows for easy detachment of the main sensor area by simply snapping the PCB along designated lines, enabling various implementation possibilities. For detailed information about Click Snap, please visit the official page dedicated to this feature.
Specifications
Type
LED Matrix
Applications
Ideal for ambient lighting, displays, and visual indicators in various consumer electronics and industrial environments
On-board modules
1312121320437 – WL-ICLED integrated controller within LED from Würth Elektronik
Key Features
Individually addressable RGB LEDs with integrated IC, compatibility with both 3.3V and 5V logic systems, PWM control, Click Snap feature, header for cascading multiple Snap units, and more
Interface
PWM
Feature
Click Snap,ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on 2×4 RGB Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
JP1 | VCC SEL | Left | Power Voltage Level Selection 3V3/5V: Left position 3V3, Right position 5V |
2×4 RGB Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Software Support
We provide a library for the 2×4 RGB Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Library Description
This library contains API for 2×4 RGB Click driver.
Key functions
-
c2x4rgb_set_leds_intensity
This function sets the brightness and current gain level of all LEDs in the led matrix. -
c2x4rgb_set_led_color
This function sets the color of the selected LED in the LED matrix. -
c2x4rgb_write_led_matrix
This function writes the LED matrix data from the click context object.
Example Description
This example demonstrates the use of 2×4 RGB click board by cycling through a set of colors, gradually increasing the brightness of each LED in a sequence, and then decreasing the brightness before moving on to the next color in the array.
void application_task ( void )
{
static uint32_t color_num = 0;
static int8_t led_cnt = 0;
static int8_t brightness = 0;
log_printf( &logger, " Color: %s [%.6LX]rnn", color[ color_num ].name, color[ color_num ].rgb );
Delay_ms ( 100 );
c2x4rgb_set_leds_intensity ( &c2x4rgb, C2X4RGB_LED_BRIGHTNESS_MIN, C2X4RGB_LED_CURRENT_GAIN_DEFAULT );
for ( led_cnt = C2X4RGB_LED_7; led_cnt >= C2X4RGB_LED_0; led_cnt-- )
{
c2x4rgb_set_led_color ( &c2x4rgb, led_cnt, color[ color_num ].rgb );
c2x4rgb_write_led_matrix ( &c2x4rgb );
Delay_ms ( 100 );
}
for ( brightness = C2X4RGB_LED_BRIGHTNESS_MIN; brightness < C2X4RGB_LED_BRIGHTNESS_MAX; brightness++ )
{
c2x4rgb_set_leds_intensity ( &c2x4rgb, brightness, C2X4RGB_LED_CURRENT_GAIN_DEFAULT );
c2x4rgb_write_led_matrix ( &c2x4rgb );
Delay_ms ( 50 );
}
for ( brightness = C2X4RGB_LED_BRIGHTNESS_MAX; brightness >= C2X4RGB_LED_BRIGHTNESS_MIN; brightness-- )
{
c2x4rgb_set_leds_intensity ( &c2x4rgb, brightness, C2X4RGB_LED_CURRENT_GAIN_DEFAULT );
c2x4rgb_write_led_matrix ( &c2x4rgb );
Delay_ms ( 50 );
}
if ( ++color_num >= C2X4RGB_NUM_COLORS )
{
color_num = 0;
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Other MIKROE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.2x4RGB
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 MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.