TOP Contributors

  1. MIKROE (2751 codes)
  2. Alcides Ramos (372 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 (139050 times)
  2. FAT32 Library (71588 times)
  3. Network Ethernet Library (56988 times)
  4. USB Device Library (47326 times)
  5. Network WiFi Library (43005 times)
  6. FT800 Library (42295 times)
  7. GSM click (29754 times)
  8. mikroSDK (27873 times)
  9. PID Library (26858 times)
  10. microSD click (26129 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

7-SEG RGB Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.21

mikroSDK Library: 2.0.0.0

Category: LED segment

Downloaded: 315 times

Not followed.

License: MIT license  

7-SEG RGB Click carries a full color single 7 segment digit display. The Click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over the CS, and PWM pin on the mikroBUS™ line.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "7-SEG RGB Click" changes.

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

Do you want to report abuse regarding "7-SEG RGB Click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


7-SEG RGB Click

7-SEG RGB Click carries a full color single 7 segment digit display. The Click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over the CS, and PWM pin on the mikroBUS™ line.

7segrgb_click.png

Click Product page


Click library

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

Software Support

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

Standard key functions :

  • c7segrgb_cfg_setup This function initializes Click configuration structure to init state.

    void c7segrgb_cfg_setup ( c7segrgb_cfg_t *cfg );
  • c7segrgb_init This function initializes all necessary pins and peripherals used for this Click.

    err_t c7segrgb_init ( c7segrgb_t *ctx, c7segrgb_cfg_t *cfg );

Example key functions :

  • c7segrgb_set_num The function sets character and its color.

    void c7segrgb_set_num ( c7segrgb_t *ctx, uint8_t character, uint8_t green_brightness, uint8_t red_brightness, uint8_t blue_brightness );
  • c7segrgb_set_seven_seg The function sets the state and color of every segment from Click board object segment array data.

    void c7segrgb_set_seven_seg ( c7segrgb_t *ctx );

Examples Description

This Click shows all ten digits on a full-color single 7 segment digit display. Each segment has R, G, B LEDs that can be adjusted in 255 steps and the ability to control the brightness of all the LED.

The demo application is composed of two sections :

Application Init

Initialization driver enables - GPIO.


void application_init ( void )
{
    c7segrgb_cfg_t cfg;

    //  Click initialization.
    c7segrgb_cfg_setup( &cfg );
    cfg.logic_one = &logic_one;
    cfg.logic_zero = &logic_zero;
    C7SEGRGB_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    c7segrgb_init( &c7segrgb, &cfg );

    for ( uint8_t cnt = 0; cnt < 8; cnt++ )
    {
        c7segrgb.segments[ cnt ] = segments_data[ cnt ];
    }
    c7segrgb_set_seven_seg( &c7segrgb );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

Application Task

This is an example which demonstrates the use of 7-SEG RGB Click board. This simple example shows all ten digits in different colors on 7-SEG RGB Click.


void application_task ( void )
{
    for ( uint8_t cnt_i = 0; cnt_i < 10; cnt_i++ )
    {
        for ( uint8_t cnt_j = 10; cnt_j > 0; cnt_j-- )
        {
            c7segrgb_set_num( &c7segrgb, CHARACTER_TABLE[ cnt_i ], 4 * cnt_i, 4 * cnt_j, cnt_i * cnt_j );
            Delay_ms ( 100 );
        }
    }

    c7segrgb_set_num( &c7segrgb, C7SEGRGB_POINT, 10, 10, 10 );
    Delay_ms ( 1000 );

    c7segrgb_set_num( &c7segrgb, C7SEGRGB_ZERO, 40, 40, 40 );
    Delay_ms ( 1000 );

    c7segrgb_set_num( &c7segrgb, C7SEGRGB_ONE, 40, 0, 0 );
    Delay_ms ( 1000 );

    c7segrgb_set_num( &c7segrgb, C7SEGRGB_TWO, 0, 40, 0 );
    Delay_ms ( 1000 );

    c7segrgb_set_num( &c7segrgb, C7SEGRGB_THREE, 0, 0, 40 );
    Delay_ms ( 1000 );

    c7segrgb_set_num( &c7segrgb, C7SEGRGB_FOUR, 40, 0, 40 );
    Delay_ms ( 1000 );

    c7segrgb_set_num( &c7segrgb, C7SEGRGB_FIVE, 0, 40, 40 );
    Delay_ms ( 1000 );

    c7segrgb_set_num( &c7segrgb, C7SEGRGB_SIX, 40, 40, 0 );
    Delay_ms ( 1000 );

    c7segrgb_set_num( &c7segrgb, C7SEGRGB_SEVEN, 20, 30, 40 );
    Delay_ms ( 1000 );

    c7segrgb_set_num( &c7segrgb, C7SEGRGB_EIGHT, 40, 15, 31 );
    Delay_ms ( 1000 );

    c7segrgb_set_num( &c7segrgb, C7SEGRGB_NINE, 20, 10, 30 );
    Delay_ms ( 1000 );
}

Note

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

Additional Functions :
void logic_one ( )  - Generic logic one function.
void logic_zero ( ) - Generic logic zero function.

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

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

Stepper 17 Click

0

Stepper 17 Click is a compact add-on board that contains a bipolar stepper motor driver. This board features the TB67S539FTG, a two-phase bipolar stepping motor driver using a PWM chopper from Toshiba Semiconductor.

[Learn More]

4G LTE-E Click

0

4G LTE Click is an LTE Cat 1 / 2G multimode cellular network solution, featuring the compact LARA-R2 series modem from u-blox. This module supports up to three LTE bands and GSM bands. It also features a full range of options for the high speed cellular networking and communication, such as the network indication, full embedded TCP/UDP stack, HTTP and HTTPS transfer protocols, IPv4/IPv6 dual-stack support, secondary antenna for the RX diversity, antenna detection, jamming signal detection, embedded TLS 1.2 protocol for the improved security and more. 4G LARA Click can achieve data rates up to 10.3 Mbps/5.2 Mbps (downlink/uplink).

[Learn More]

7x10 R Click

0

7x10 R Click is a LED dot matrix display Click, which can be used to display graphics or letters in a very simple and easy way. The Click board has two LED dot matrix modules with 7x5 stylish, round, dot-like LED elements. These displays produce clean and uniform patterns since the elements are optically isolated from each other and there is no light bleeding between the adjacent LED cells. Additionally, turn-on and turn-off times of the matrix cells are optimized for a clean and fluid display performance, with no flickering or lag.

[Learn More]