uts7segr 2.0.0.0
Main Page

UT-S 7-SEG R click

7-segment LED display is the most commonly used type of display to represent changing numerical values. The principle is very simple - seven LED segments are positioned in a certain shape and by turning specific segments on or off, the shape that resembles a specific number is lit. This method of displaying numbers was first used in the beginning of the 20th century, but after the invention of the LED in ‘70, it is the most commonly used method to display numbers. It utilizes a fairly simple and cheap design with the numbers clearly visible.

click Product page


Click library

  • Author : Jelena Milosavljevic
  • Date : Jun 2021.
  • Type : SPI type

Software Support

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

Standard key functions :

Example key functions :

  • uts7segr_generic_write This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
    err_t uts7segr_generic_write ( uts7segr_t *ctx, uint8_t *data_in );
    err_t uts7segr_generic_write(uts7segr_t *ctx, uint8_t *data_in)
    UT-S 7-SEG R data writing function.
  • uts7segr_display_state This function display state.
    void uts7segr_display_state ( uts7segr_t *ctx, uint8_t state );
    void uts7segr_display_state(uts7segr_t *ctx, uint8_t state)
    UT-S 7-SEG R display state function.
  • uts7segr_display_number This function displays number on dispaly matrix.
    err_t uts7segr_display_number ( uts7segr_t *ctx, uint8_t number, uint8_t dot_pos );
    err_t uts7segr_display_number(uts7segr_t *ctx, uint8_t number, uint8_t dot_pos)
    UT-S 7-SEG R display number function.

Example Description

‍The demo application shows basic usage of the UT 7 SEG display.

The demo application is composed of two sections :

Application Init

‍Configuring clicks and log objects. Settings the click in the default configuration.

void application_init ( void ) {
log_cfg_t log_cfg;
uts7segr_cfg_t uts7segr_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
Delay_ms ( 100 );
log_info( &logger, " Application Init " );
// Click initialization.
uts7segr_cfg_setup( &uts7segr_cfg );
UTS7SEGR_MAP_MIKROBUS( uts7segr_cfg, MIKROBUS_1 );
err_t init_flag = uts7segr_init( &uts7segr, &uts7segr_cfg );
if ( init_flag == SPI_MASTER_ERROR ) {
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
uts7segr_default_cfg ( &uts7segr );
log_info( &logger, " Application Task " );
}
#define UTS7SEGR_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition uts7segr.h:95
void application_init(void)
Definition main.c:28

Application Task

‍Draws numbers from 0 to 99 on the screen.

void application_task ( void ) {
log_info( &logger, "---- Number counter ----" );
for ( uint8_t cnt = 0; cnt < 100; cnt++ ) {
Delay_ms ( 500 );
}
}
#define UTS7SEGR_DOT_LEFT
Definition uts7segr.h:74
void application_task(void)
Definition main.c:61

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.UT-S7-SEGR

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.