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 (136876 times)
  2. FAT32 Library (70003 times)
  3. Network Ethernet Library (55999 times)
  4. USB Device Library (46305 times)
  5. Network WiFi Library (41927 times)
  6. FT800 Library (41208 times)
  7. GSM click (29012 times)
  8. PID Library (26423 times)
  9. mikroSDK (26398 times)
  10. microSD click (25386 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

OLED W click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.15

mikroSDK Library: 2.0.0.0

Category: OLED

Downloaded: 268 times

Not followed.

License: MIT license  

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.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "OLED W click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "OLED W click" changes.

Do you want to report abuse regarding "OLED W click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


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.

oled_w_click.png

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 );
  • oledw_init Initialization function.

    err_t oledw_init ( oledw_t *ctx, oledw_cfg_t *cfg );

Example key functions :

  • oledw_send This function sends commands or data to OLED W click.

    err_t oledw_send( oledw_t *ctx, oledw_data_t tx_data, oledw_data_mode_t data_mode );
  • oledw_display_picture This function allows user to display picture for page addressing mode.

    void oledw_display_picture( oledw_t *ctx, oledw_resources_t *pic );
  • oledw_set_contrast This function sets the display contrast level (0 to 255).

    void oledw_set_contrast( oledw_t *ctx, oledw_data_t value );

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;  /**< Logger config object. */
    oledw_cfg_t oledw_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    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 " );
}

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;

    oledw_display_picture( &oledw, oledw_img );
    Delay_ms ( 500 );
    oledw_send( &oledw, OLEDW_INVERTDISPLAY, OLEDW_COMMAND );
    Delay_ms ( 500 );
    oledw_send( &oledw, OLEDW_NORMALDISPLAY, OLEDW_COMMAND );
    Delay_ms ( 500 );
    oledw_send( &oledw, OLEDW_INVERTDISPLAY, OLEDW_COMMAND );
    Delay_ms ( 500 );
    oledw_send( &oledw, OLEDW_NORMALDISPLAY, OLEDW_COMMAND );
    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_display_picture( &oledw, oledw_img );

    oledw_scroll_left( &oledw, 0x00, 0x05 );
    Delay_ms ( 1000 );
    oledw_stop_scroll( &oledw );
    oledw_display_picture( &oledw, oledw_img );

    oledw_scroll_diag_right( &oledw, 0x00, 0x05 );
    Delay_ms ( 1000 );
    oledw_stop_scroll( &oledw );
    oledw_display_picture( &oledw, oledw_img );

    oledw_scroll_diag_left( &oledw, 0x00, 0x05 );
    Delay_ms ( 1000 );
    oledw_stop_scroll( &oledw );
}

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.


ALSO FROM THIS AUTHOR

Brushless 17 click

0

Brushless 17 Click is a compact add-on board suitable for controlling brushless DC (BLDC) motors with any MCU. This board features the L6229Q, DMOS fully integrated three-phase BLDC motor driver with overcurrent protection from STMicroelectronics. This motor driver combines isolated DMOS power transistors with CMOS and bipolar circuits on the same chip, realized in BCD (Bipolar-CMOS-DMOS) multipower technology. It includes all the circuitry for a three-phase BLDC motor drive, including a three-phase DMOS bridge, a constant off-time PWM current controller, and the decoding logic for single-ended hall sensors that generate the required sequence for the power stage.

[Learn More]

7seg click

0

7seg Click is an accessory board in mikroBus form factor. It features two 74HC595 8-bit serial-in, parallel-out shift register modules as well as two seven-segment displays. 7seg Click communicates with target board via SPI interface. The board is designed to use 3.3V and 5V power supply.

[Learn More]

Fan 2 click

6

Fan 2 click carries the MAX31760 precision fan-speed controller. It can also measure temperature and adjust the fan speed to keep the temperature at the same level. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over I2C interface.

[Learn More]