c10x10rgb2  2.1.0.0
Main Page

10x10 RGB 2 click

10x10 RGB 2 Click is a compact add-on board designed for creating vibrant LED displays and lighting solutions. This board features the IN-PC20TBT5R5G5B, an RGB LED with an advanced IC for seamless operation from Inolux. The board features a 10x10 matrix of "smart" RGB LEDs capable of dual-wire transmission and a sophisticated control circuit for dynamic color rendering. It incorporates CMOS technology for low power consumption and supports 256 grayscale levels for precise PWM dimming, along with 32 levels of brightness control.

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Nov 2023.
  • Type : SPI type

Software Support

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

Standard key functions :

Example key functions :

  • c10x10rgb2_write_char This function writes a single ASCII character in a 8x8 font size.
    err_t c10x10rgb2_write_char ( c10x10rgb2_t *ctx, uint8_t data_in );
  • c10x10rgb2_write_string This function writes a text string in a 8x8 font size by scrolling characters to the left side.
    err_t c10x10rgb2_write_string ( c10x10rgb2_t *ctx, uint8_t *data_in, uint16_t speed_ms );
  • c10x10rgb2_draw_picture This function draws a 10x10px picture on the screen.
    err_t c10x10rgb2_draw_picture ( c10x10rgb2_t *ctx, const uint32_t *image );

Example Description

This example demonstrates the use of the 10x10 RGB 2 click board by showing a practical example of using the implemented functions.

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;
c10x10rgb2_cfg_t c10x10rgb2_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
c10x10rgb2_cfg_setup( &c10x10rgb2_cfg );
C10X10RGB2_MAP_MIKROBUS( c10x10rgb2_cfg, MIKROBUS_1 );
if ( SPI_MASTER_ERROR == c10x10rgb2_init( &c10x10rgb2, &c10x10rgb2_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( C10X10RGB2_ERROR == c10x10rgb2_default_cfg ( &c10x10rgb2 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}

Application Task

Displays digits 0-9 first, then writes RGB chars and demonstrates the rotation of characters.

After that, scrolls the text, displays the MIKROE logo image, and showcases a rainbow demo. All data is logged on the USB UART where you can track the program flow.

void application_task ( void )
{
log_printf( &logger, " Writing digits\r\n\n" );
for ( uint8_t digit = '0'; digit <= '9'; digit++ )
{
c10x10rgb2_write_char ( &c10x10rgb2, digit );
Delay_ms ( 500 );
}
log_printf( &logger, " Writing RGB chars\r\n\n" );
c10x10rgb2_write_char ( &c10x10rgb2, 'R' );
Delay_ms ( 1000 );
c10x10rgb2_write_char ( &c10x10rgb2, 'G' );
Delay_ms ( 1000 );
c10x10rgb2_write_char ( &c10x10rgb2, 'B' );
Delay_ms ( 1000 );
log_printf( &logger, " Rotating char\r\n\n" );
c10x10rgb2_write_char ( &c10x10rgb2, 'R' );
Delay_ms ( 500 );
c10x10rgb2_write_char ( &c10x10rgb2, 'R' );
Delay_ms ( 500 );
c10x10rgb2_write_char ( &c10x10rgb2, 'R' );
Delay_ms ( 500 );
c10x10rgb2_write_char ( &c10x10rgb2, 'R' );
Delay_ms ( 500 );
c10x10rgb2_write_char ( &c10x10rgb2, 'R' );
Delay_ms ( 500 );
log_printf( &logger, " Writing text\r\n\n" );
c10x10rgb2_write_string ( &c10x10rgb2, "MIKROE 10x10 RGB 2", 50 );
Delay_ms ( 1000 );
log_printf( &logger, " Drawing MIKROE logo\r\n\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, " Rainbow demo\r\n\n" );
c10x10rgb2_demo_rainbow ( &c10x10rgb2, 10, 10, 500 );
Delay_ms ( 500 );
}

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.10x10RGB2

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.


c10x10rgb2_draw_picture
err_t c10x10rgb2_draw_picture(c10x10rgb2_t *ctx, const uint32_t *image)
10x10 RGB 2 draw picture function.
c10x10rgb2_t
10x10 RGB 2 Click context object.
Definition: c10x10rgb2.h:287
C10X10RGB2_ROTATION_V_0
#define C10X10RGB2_ROTATION_V_0
10x10 RGB 2 text ASCII byte rotation.
Definition: c10x10rgb2.h:217
C10X10RGB2_COLOR_OLIVE
#define C10X10RGB2_COLOR_OLIVE
Definition: c10x10rgb2.h:207
c10x10rgb2_write_char
err_t c10x10rgb2_write_char(c10x10rgb2_t *ctx, uint8_t data_in)
10x10 RGB 2 write char function.
c10x10rgb2_demo_rainbow
err_t c10x10rgb2_demo_rainbow(c10x10rgb2_t *ctx, uint8_t rgb_pct, uint16_t upd_rate_ms, uint16_t upd_num)
10x10 RGB 2 demo rainbow function.
C10X10RGB2_COLOR_BLUE
#define C10X10RGB2_COLOR_BLUE
Definition: c10x10rgb2.h:200
C10X10RGB2_ROTATION_H_0
#define C10X10RGB2_ROTATION_H_0
Definition: c10x10rgb2.h:219
application_task
void application_task(void)
Definition: main.c:67
C10X10RGB2_ERROR
@ C10X10RGB2_ERROR
Definition: c10x10rgb2.h:321
c10x10rgb2_default_cfg
err_t c10x10rgb2_default_cfg(c10x10rgb2_t *ctx)
10x10 RGB 2 default configuration function.
c10x10rgb2_init
err_t c10x10rgb2_init(c10x10rgb2_t *ctx, c10x10rgb2_cfg_t *cfg)
10x10 RGB 2 initialization function.
C10X10RGB2_ROTATION_V_180
#define C10X10RGB2_ROTATION_V_180
Definition: c10x10rgb2.h:218
c10x10rgb2_write_string
err_t c10x10rgb2_write_string(c10x10rgb2_t *ctx, uint8_t *data_in, uint16_t speed_ms)
10x10 RGB 2 write char function.
c10x10rgb2_set_pen
void c10x10rgb2_set_pen(c10x10rgb2_t *ctx, uint32_t txt_rgb, uint32_t bg_rgb, uint8_t rotation)
10x10 RGB 2 set pen function.
C10X10RGB2_COLOR_MAROON
#define C10X10RGB2_COLOR_MAROON
Definition: c10x10rgb2.h:206
c10x10rgb2_cfg_setup
void c10x10rgb2_cfg_setup(c10x10rgb2_cfg_t *cfg)
10x10 RGB 2 configuration object setup function.
C10X10RGB2_MAP_MIKROBUS
#define C10X10RGB2_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: c10x10rgb2.h:249
C10X10RGB2_COLOR_BLACK
#define C10X10RGB2_COLOR_BLACK
10x10 RGB 2 24-bit RGB color codes.
Definition: c10x10rgb2.h:196
application_init
void application_init(void)
Definition: main.c:31
C10X10RGB2_COLOR_RED
#define C10X10RGB2_COLOR_RED
Definition: c10x10rgb2.h:198
c10x10rgb2_cfg_t
10x10 RGB 2 Click configuration object.
Definition: c10x10rgb2.h:302
C10X10RGB2_COLOR_GREEN
#define C10X10RGB2_COLOR_GREEN
Definition: c10x10rgb2.h:208
C10X10RGB2_COLOR_PURPLE
#define C10X10RGB2_COLOR_PURPLE
Definition: c10x10rgb2.h:209
C10X10RGB2_ROTATION_H_180
#define C10X10RGB2_ROTATION_H_180
Definition: c10x10rgb2.h:220
c10x10rgb_img_mikroe
const uint32_t c10x10rgb_img_mikroe[]
Memory buffers for 10x10 RGB 2 click.