TOP Contributors

  1. MIKROE (2664 codes)
  2. Alcides Ramos (358 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 (137149 times)
  2. FAT32 Library (70246 times)
  3. Network Ethernet Library (56134 times)
  4. USB Device Library (46452 times)
  5. Network WiFi Library (42110 times)
  6. FT800 Library (41414 times)
  7. GSM click (29126 times)
  8. mikroSDK (26572 times)
  9. PID Library (26512 times)
  10. microSD click (25509 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 Switch click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.14

mikroSDK Library: 2.0.0.0

Category: OLED

Downloaded: 241 times

Not followed.

License: MIT license  

If you are building any type of human machine interface, OLED Switch click can help you keep the design simple, clear and interactive. It can be used in designing a control panel for an industrial machine… or a DIY arcade.

No Abuse Reported

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

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

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

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


OLED Switch click

If you are building any type of human machine interface, OLED Switch click can help you keep the design simple, clear and interactive. It can be used in designing a control panel for an industrial machine… or a DIY arcade.

oledswitch_click.png

click Product page


Click library

  • Author : MikroE Team
  • Date : Feb 2020.
  • Type : SPI type

Software Support

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

Standard key functions :

  • Config Object Initialization function.

    void oledswitch_cfg_setup ( oledswitch_cfg_t *cfg );

  • Initialization function.

    OLEDSWITCH_RETVAL oledswitch_init ( oledswitch_t ctx, oledswitch_cfg_t cfg );

  • Click Default Configuration function.

    void oledswitch_default_cfg ( oledswitch_t *ctx );

Example key functions :

  • This function writes to control and configuration registers on the chip.

    oledswitch_reg_write ( oledswitch_t ctx, uint8_t write_buf, uint8_t len );

  • This function sets the digital output signal for the PWM pin.

    void oledswitch_digital_write_pwm ( oledswitch_t *ctx, uint8_t signal );

  • This function sets the digital output signal for the RST pin.

    void oledswitch_digital_write_rst ( oledswitch_t *ctx, uint8_t signal );

Examples Description

This example showcases how to configure and use the OLED Switch click. This click is a combination of a button and a full color organic LED display. Displays settings are first loaded onto the chip and after that you can show any 64x48 pixel image on the display.

The demo application is composed of two sections :

Application Init

This function initializes and configures the click modules. In order for the click to work properly, you need to configure display and power settings. The full initialization of the chip is done in the default_cfg(...) function.


void application_init ( )
{
    oledswitch_cfg_t cfg;

    //  Click initialization.

    oledswitch_cfg_setup( &cfg );
    OLEDSWITCH_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    oledswitch_init( &oledswitch, &cfg );
    oledswitch_default_cfg( &oledswitch, OLEDSWITCH_BUFFER_SIZE_SMALL );
}

Application Task

This function shows the user how to display images on the OLED screen. Every image you'd like to display needs to have a resolution of 64x48 and be stored in a 6144 cell array.


void application_task ( )
{
    oledswitch_draw_image( &oledswitch, array_red, OLEDSWITCH_IMG_SIZE_NORMAL );
    Delay_1sec( );

    oledswitch_draw_image( &oledswitch, array_green, OLEDSWITCH_IMG_SIZE_NORMAL );
    Delay_1sec( );

    oledswitch_draw_image( &oledswitch, array_blue, OLEDSWITCH_IMG_SIZE_NORMAL );
    Delay_1sec( );
} 

Note

Every pixel on the OLED screen is displayed at the time of writing to the chip (PWM 1). Displaying speed can be directly controled by adding delays in the for loop section of the draw_image(...) 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.OledSwitch

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

Accel 3 click

0

Accel 3 Click represent 3-axis linear accelerometer.

[Learn More]

Ozone 2 click

0

Ozone 2 click is an Ozone detection (O3) sensor, based on the MQ131 gas sensor. This gas sensor has a sensitive layer made of SnO2, which changes its resistance when exposed to ozone.

[Learn More]

Magneto 6 click

0

Magneto 6 Click features low power three dimensional Hall effect sensor, TLI493D-A2B6, designed for magnetic sensing applications. It measures the magnetic field in X, Y, and Z direction. Each X, Y and Z Hall probe is connected sequentially to a multiplexer, which is then connected to an Analog to Digital Converter (ADC). Optional, the temperature can be determined as well after the three Hall channels. The data measurement is provided in digital format to the microcontroller over the standard I2C interface. Some of the benefits of this Click board™ are wide application range addressable due to high flexibility and component reduction due to the 3D magnetic measurement principle.

[Learn More]