oledw 2.0.0.0
Main Page

OLED W click

OLED W click carries a 96 x 39px white monochrome passive matrix OLED display. The display is bright, has a wide viewing angle and low power consumption.

click Product page


Click library

  • Author : Stefan Ilic
  • Date : Jun 2021.
  • Type : I2C/SPI type

Software Support

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

Standard key functions :

  • oledw_cfg_setup Config Object Initialization function.
    void oledw_cfg_setup(oledw_cfg_t *cfg)
    Configuration Object Setup function.
    Click configuration structure definition.
    Definition oledw.h:200
  • oledw_init Initialization function.
    #define err_t
    Definition oledw.h:121
    err_t oledw_init(oledw_t *ctx, oledw_cfg_t *cfg)
    Click Initialization function.
    Click context object definition.
    Definition oledw.h:175

Example key functions :

Example Description

‍This example demonstrates the use (control) of the OLED W display.

The demo application is composed of two sections :

Application Init

‍Configures the microcontroller for communication and initializes the click board to default state.

void application_init ( void ) {
log_cfg_t log_cfg;
oledw_cfg_t oledw_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
Delay_ms ( 100 );
log_info( &logger, " Application Init " );
// Click initialization.
oledw_cfg_setup( &oledw_cfg );
OLEDW_MAP_MIKROBUS( oledw_cfg, MIKROBUS_1 );
err_t init_flag = oledw_init( &oledw, &oledw_cfg );
if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) ) {
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
oledw_default_cfg ( &oledw );
log_info( &logger, " Application Task " );
}
#define OLEDW_MAP_MIKROBUS(cfg, mikrobus)
Definition oledw.h:140
void oledw_default_cfg(oledw_t *ctx)
Click Default Configuration function.
void application_init(void)
Definition main.c:30

Application Task

‍This section contains the main program that is executed showing a practical example on how to use the implemented functions.

void application_task ( void ) {
uint8_t i;
Delay_ms ( 500 );
Delay_ms ( 500 );
Delay_ms ( 500 );
Delay_ms ( 500 );
Delay_ms ( 300 );
for (i = 0xAF; i > 0x00; i--) {
oledw_set_contrast( &oledw, i );
Delay_ms ( 5 );
}
for (i = 0x00; i < 0xAF; i++) {
oledw_set_contrast( &oledw, i );
Delay_ms ( 5 );
}
oledw_scroll_right( &oledw, 0x00, 0x05 );
Delay_ms ( 1000 );
oledw_stop_scroll( &oledw );
oledw_scroll_left( &oledw, 0x00, 0x05 );
Delay_ms ( 1000 );
oledw_stop_scroll( &oledw );
oledw_scroll_diag_right( &oledw, 0x00, 0x05 );
Delay_ms ( 1000 );
oledw_stop_scroll( &oledw );
oledw_scroll_diag_left( &oledw, 0x00, 0x05 );
Delay_ms ( 1000 );
oledw_stop_scroll( &oledw );
}
#define OLEDW_COMMAND
Definition oledw.h:100
void oledw_scroll_left(oledw_t *ctx, oledw_data_t start_page_addr, oledw_data_t end_page_addr)
Scroll Left function.
void oledw_scroll_diag_right(oledw_t *ctx, oledw_data_t start_page_addr, oledw_data_t end_page_addr)
Scroll Diagonally Right function.
void oledw_stop_scroll(oledw_t *ctx)
Stop Scrolling function.
void oledw_scroll_right(oledw_t *ctx, oledw_data_t start_page_addr, oledw_data_t end_page_addr)
Scroll Right function.
void oledw_scroll_diag_left(oledw_t *ctx, oledw_data_t start_page_addr, oledw_data_t end_page_addr)
Scroll Diagonally Left function.
#define OLEDW_INVERTDISPLAY
Definition oledw.h:78
#define OLEDW_NORMALDISPLAY
Definition oledw.h:75
void application_task(void)
Definition main.c:63
oledw_resources_t oledw_img[480]
Memory buffer for 96x39 OLED monochrome module.
Definition resources.h:6

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

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.