TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (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 (136872 times)
  2. FAT32 Library (70000 times)
  3. Network Ethernet Library (55999 times)
  4. USB Device Library (46305 times)
  5. Network WiFi Library (41916 times)
  6. FT800 Library (41206 times)
  7. GSM click (29012 times)
  8. PID Library (26423 times)
  9. mikroSDK (26395 times)
  10. microSD click (25385 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

4x4 RGB click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-04

Package Version: 2.1.0.19

mikroSDK Library: 2.0.0.0

Category: LED matrix

Downloaded: 185 times

Not followed.

License: MIT license  

4x4 RGB click is a matrix of 16 intelligent RGB elements, forming a 4x4 display screen.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "4x4 RGB click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "4x4 RGB click" changes.

Do you want to report abuse regarding "4x4 RGB click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


4x4 RGB click

4x4 RGB click is a matrix of 16 intelligent RGB elements, forming a 4x4 display screen.

4x4rgb_click.png

click Product page


Click library

  • Author : MikroE Team
  • Date : Jan 2020.
  • Type : GPIO type

Software Support

We provide a library for the 4x4Rgb 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 form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for 4x4Rgb Click driver.

Standard key functions :

  • c4x4rgb_cfg_setup This function initializes click configuration structure to init state.

    void c4x4rgb_cfg_setup ( c4x4rgb_cfg_t *cfg, drv_logic_t logic_zero, drv_logic_t logic_one, uint8_t select_ctrl_pin );
  • c4x4rgb_init This function initializes all necessary pins and peripherals used for this click.

    err_t c4x4rgb_init ( c4x4rgb_t *ctx, c4x4rgb_cfg_t *cfg );

Example key functions :

  • c4x4rgb_set_diode This function allows to set color of one diode.

    err_t c4x4rgb_set_diode ( c4x4rgb_t *ctx, uint32_t diode_num, uint32_t diode_color );
  • c4x4rgb_fill_screen This function sets every diode on selected color.

    void c4x4rgb_fill_screen ( c4x4rgb_t *ctx, uint32_t fill_color );

Examples Description

This application is used for powering 4x4 RGB LED matrix.

The demo application is composed of two sections :

Application Init

Initialization driver enables - GPIO.


void application_init ( void )
{
    c4x4rgb_cfg_t cfg;

    //  Click initialization.
    c4x4rgb_cfg_setup( &cfg, &c4x4rgb_logic_zero, &c4x4rgb_logic_one, C4X4RGB_CTRL_PIN_IN1 );
    C4X4RGB_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    c4x4rgb_init( &c4x4rgb, &cfg );

    c4x4rgb_fill_screen( &c4x4rgb, C4X4RGB_COLOR_WHITE );
    Delay_ms ( 100 ); 

    c4x4rgb_color_mash();
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

Application Task

This is an example which demonstrates the use of 4x4 RGB Click board. This simple example shows all ten numbers in different colors on 4x4 RGB click. The 4x4 RGB click carries a matrix of 16 RGB LEDs and an MCP1826 low dropout regulator. These LEDs actually consist of three single colored LEDs ( Red, Green and Blue ) in a single package. Various colors can be reproduced by mixing the intensity of each LED.


void application_task ( void )
{
    c4x4rgb_snake( C4X4RGB_COLOR_BLUE );
    Delay_ms ( 500 ); 

    c4x4rgb_snake_return( C4X4RGB_COLOR_LIGHT_BLUE );
    Delay_ms ( 1000 ); 

    c4x4rgb_snake(  C4X4RGB_COLOR_GREEN );
    Delay_ms ( 500 ); 

    c4x4rgb_snake_return( C4X4RGB_COLOR_YELLOW );
    Delay_ms ( 1000 ); 

    c4x4rgb_snake( C4X4RGB_COLOR_RED );
    Delay_ms ( 500 ); 

    c4x4rgb_snake_return( C4X4RGB_COLOR_PURPLE );
    Delay_ms ( 1000 ); 

    c4x4rgb_fill_screen( &c4x4rgb, C4X4RGB_COLOR_WHITE );
    Delay_ms ( 100 ); 
}

Note

Make sure the logic delays are defined for your system in the c4x4rgb_delays.h file.

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.4x4Rgb

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. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.


ALSO FROM THIS AUTHOR

Step Down 2 Click

5

The Step Down 2 click is a Click board equipped with the L6986HTR, a synchronous step-down switching regulator from STMicroelectronics. Because of the main possibilities its features offer, the Step Down 2 click is ideally used for programmable logic controllers (PLCs), decentralized intelligent nodes, sensors, and low noise applications (LNM).

[Learn More]

Serializer click

0

Serializer Click is a compact add-on board that contains a digital input translator/serializer. This board features the MAX31910, an eight-channel digital input serializer for high-channel density digital input modules in industrial and process automation from Analog Devices. The MAX31910 translates, conditions, and serializes the 24V digital output of sensors and switches to 5V CMOS-compatible signals required by the MCU. It provides the front-end interface circuit of a programmable logic controller (PLC) digital input module. It communicates with MCU via the SPI interface and comes in configuration with an installed digital isolator. This Click board™ is suited for various applications such as industrial, process, and building automation, digital input modules for PLCs, and more.

[Learn More]

MCP2518FD click

5

MCP2518FD Click is a compact add-on board representing a complete CAN solution used as a control node in a CAN network. This board features the MCP2518FD, an external CAN FD controller with an SPI interface, and a high-speed CAN transceiver, the ATA6563, both from Microchip. The ATA6563, a low-level physical layer IC (PHY), provides a physical connection with the CAN bus itself, while the CAN controller MCP2518FD represents an interface between the MCU and the PHY. It features three operating modes with dedicated fail-safe features, remote wake-up via CAN, and ideally passive behavior when powered off on the CAN bus. This Click boardâ„¢ is suitable for developing a wide range of automotive diagnostic applications, even on MCUs that do not natively support CAN interface.

[Learn More]