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]
Rating:
Author: MIKROE
Last Updated: 2024-10-31
Package Version: 2.1.0.16
mikroSDK Library: 2.0.0.0
Category: OLED
Downloaded: 288 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.
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".
DOWNLOAD LINK | RELATED COMPILER | CONTAINS |
---|---|---|
3631_oled_switch_clic.zip [604.69KB] | mikroC AI for ARM GCC for ARM Clang for ARM mikroC AI for PIC mikroC AI for PIC32 XC32 GCC for RISC-V Clang for RISC-V mikroC AI for AVR mikroC AI for dsPIC XC16 |
|
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.
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.
This library contains API for OledSwitch Click driver.
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 );
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 );
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 :
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 );
}
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( );
}
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:
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.