Matrix G Click
Matrix G Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.
Click Library
- Author : Jelena Milosavljevic
- Date : Jun 2021.
- Type : SPI type
Software Support
Example Description
This example showcases how to prepare the logger and Click modules for use and how to display ASCII characters on both of the LED segments of the Click.
Example Libraries
- MikroSDK.Board
- MikroSDK.Log
- Click.MatrixG
Example Key Functions
- matrixg_cfg_setup Config Object Initialization function.
void matrixg_cfg_setup(matrixg_cfg_t *cfg)
Config Object Initialization function.
Click configuration structure definition.
Definition matrixg.h:180
- matrixg_init Initialization function.
MATRIXG_RETVAL matrixg_init(matrixg_t *ctx, matrixg_cfg_t *cfg)
Initialization function.
Click ctx object definition.
Definition matrixg.h:163
- matrixg_default_cfg Click Default Configuration function.
void matrixg_default_cfg(matrixg_t *ctx)
Click Default Configuration function.
- matrixg_display_characters This function displays the specified characters on the L/R segments of the Click.
void matrixg_display_characters(matrixg_t *ctx, uint8_t left_char, uint8_t right_char)
Display characters function.
- matrixg_set_csn_high This function sets the CSN pin output to high.
void matrixg_set_csn_high(matrixg_t *ctx)
Set CSN pin to high function.
- matrixg_set_csn_low This function sets the CSN pin output to low.
void matrixg_set_csn_low(matrixg_t *ctx)
Set CSN pin to low function.
Application Init
This function initializes and configures the logger and Click modules. After the initialization of the logger module, communication, mikrobus and pin setup, some of the registers are configured in order for the Click module to work properly.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
Delay_ms ( 100 );
Delay_ms ( 100 );
}
#define MATRIXG_MAP_MIKROBUS(cfg, mikrobus)
Definition matrixg.h:70
void application_init()
Definition main.c:40
Application Task
This function displays two strings on each of the LED segments, showing one character every second. It should display " Mikroelektronika" on the left one and "Mikroelektronika " on the right.
{
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000);
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 100 );
Delay_ms ( 100 );
}
void application_task()
Definition main.c:68
Note
The Click has two chips, each controlling one of the LED segments, on and requires you to write data to both at the same time. Writing to one specific chip will not work. If you wish to display characters on a single segment, you have to send ' ' characters to the other segment.
Application Output
This Click board can be interfaced and monitored in two ways:
- Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
- UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.
Additional Notes and Information
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.