top of page

Safari browser sometimes has issues displaying images...

I.e: *you have to click on the images to see them...

For a better browsing experience on Brainy-Bits

Please use Chrome, Edge or Firefox browser.

  • Writer's pictureBrainy-Bits

Finally a Bigger OLED display to use with an Arduino – 128×128 1.5 inch



OVERVIEW


OLED displays have a lot of advantages compared to other displays you might use with an Arduino:

  • They require very little power unlike LCD displays, maximum for this one is 0.75mA, compare that to a Nokia 5110 which can go as high as 80mA

  • They can display graphics as well as text

  • Have high resolutions

  • And are relatively easy to connect and use with an Arduino

But they can be more expensive considering their size compared to other displays.


Most of the cheap OLED displays are under one inch in size and their resolution only go up to 128×64.


Until now!



While browsing around I found this relatively inexpensive (~ $20cnd) OLED display on Amazon, but you can find it elsewhere for less than that.


It’s got the advantage of being 1.5 inch in size and has 128×128 resolution, which makes it very attractive for many projects.


The fact that it has double the vertical resolution of most OLED display out there is a big plus.


In this tutorial we will see how to display text and graphics and how to connect to an Arduino.

 

PARTS USED


OLED Display 1.5"


Arduino MEGA R3


These are Amazon affiliate links...

They don't cost you anything and it helps me keep the lights on

if you buy something on Amazon. Thank you!

 

QUICK LOOK


This OLED display uses either SPI or I2C communication, both of which are supported on the Arduino.


By default it’s configured to use SPI, which is much faster than I2C.


Since the resolution of this OLED is higher than most, SPI is better suited for this display, but depending on your application I2C might be ok.

In a future tutorial I will test the speed of two of these displays, one using I2C and one using SPI to show the performance difference, and see when to use one or the other.


The OLED display comes by default setup for SPI.


To switch from SPI to I2C all you would have to do is move the resistor on the back to choose which one you would like to use.




In this tutorial we will be using the default setting which is SPI.


With a higher resolution comes the requirement for more memory needed on the Arduino.



In this tutorial I will be using the Arduino MEGA instead of the UNO or Nano, but in a future tutorial I will be showing you how to use this display with them as well by using different ways to write to the display.

*** In my testing I found that the included connection cable wasn’t working… *** *** So I soldered some headers on the other side and then it worked. ***


If you get one of these and it’s not working when using the included connector cable you might want to try soldering some headers and try it that way.


Not saying they are all like this but it’s something to keep in mind if yours doesn’t work.

 

THE LIBRARY


I have used the U8G library in the past and it worked well with other OLED displays.


But for this one we will be using the more recent U8G2 library which has support for this SSD1327 128×128 OLED display.


Keep in mind that this OLED supports grayscale, but the U8g2 is a monochrome library, so all the images or text displayed using this library will be black and white (pixel on or off).


There’s many commands available inside this library, but we will be looking at the fast and simple way to get going by displaying some text and graphics.

You can get more information as well as a list of commands on the U8G2 Wiki page.


For more information on the programming don’t forget to watch the tutorial video below.

 

CONNECTIONS


Like I said at the beginning were are using SPI to communicate with the OLED.

We are using the hardware SPI pins of the Arduino MEGA which are:

  • Pin 51 = MOSI

  • Pin 52 = SCK

When looking at the back legend of the OLED we see that those pin are:

  • CLK pin of the oled is equal to SCK

  • and the DIN pin is equal to MOSI.

The rest of the connections are as follow:

  • VCC is connected to 5V of the Arduino

  • GND is connected GND

  • CS is connected to Digital Pin 10

  • DC is connected to Digital Pin 9

  • and RST is connected to Digital Pin 8

 

THE CODE


Like I said before, to use the OLED display I will be using the U8g2 library which is an updated version of the original U8g library.


In this tutorial I will be using the Full Screen Buffer mode which is faster but uses a lot of RAM on the Arduino, so this is why we are using the Arduino MEGA since the UNO or Nano would not have enough memory.

Two other modes are available:

  • Page Buffer mode which uses less RAM but is much slower

  • and U8x8 Character mode which require no RAM, is very fast, but can only display Text not graphics

These other modes might work with the UNO or Nano, so I will be looking at this option in a future tutorial.


To create the graphic array information, I’m using the LCD Image Converter software, link is at the bottom of this page.


Don’t forget to watch the tutorial video for more information.

/* SSD1327 1.5 Inch Oled with Arduino Mega
 
Created by Yvan / https://Brainy-Bits.com

This code is in the public domain...

You can: copy it, use it, modify it, share it or just plain ignore it!
Thx!
*/

#include <U8g2lib.h>  // U8g2 Library for Oled https://github.com/olikraus/u8g2

#define switch_pin 5  // Switch connected to pin 5 of Arduino

int loop_pass=1;  // Variable used to display text or the bitmap


/*
  U8g2 modes:
    Frame Buffer Examples: clearBuffer/sendBuffer. Fast, but may not work with all Arduino boards because of RAM consumption
    Page Buffer Examples: firstPage/nextPage. Less RAM usage, Slower, but should work with all Arduino boards.
    U8x8 Text Only Example: No RAM usage, Fast, but No graphics, 8x8 Text only.
*/
    

// U8g2 Library Full Frame Buffer mode used in this tutorial
U8G2_SSD1327_MIDAS_128X128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);


void setup(void) {
  pinMode(switch_pin, INPUT_PULLUP);  // using Input_Pullup resistor of the Arduino Mega
  u8g2.begin();  //  Start U8g2 library
  u8g2.setContrast(200);  //  Brightness setting from 0 to 255
}

// Display Text on Oled display
void drawText(void) {

  switch (loop_pass) {
    case 1:
      u8g2.setFont(u8g2_font_fub11_tr);  // Choose font to use
      u8g2.drawStr(0, 11, "PLAYER 1");  // set position and text to display
    break;

    case 2:
      u8g2.setFont(u8g2_font_fub11_tr);
      u8g2.drawStr(0, 11, "PLAYER 1");
      u8g2.setFont(u8g2_font_fub14_tr);
      u8g2.drawStr(0, 35, "PLAYER 1");
    break;

    case 3:
      u8g2.setFont(u8g2_font_fub11_tr);
      u8g2.drawStr(0, 11, "PLAYER 1");
      u8g2.setFont(u8g2_font_fub14_tr);
      u8g2.drawStr(0, 35, "PLAYER 1");
      u8g2.setFont(u8g2_font_fub17_tr);
      u8g2.drawStr(0, 62, "PLAYER 1"); 
    break;

    case 4:
      u8g2.setFont(u8g2_font_fub11_tr);
      u8g2.drawStr(0, 11, "PLAYER 1");
      u8g2.setFont(u8g2_font_fub14_tr);
      u8g2.drawStr(0, 35, "PLAYER 1");
      u8g2.setFont(u8g2_font_fub17_tr);
      u8g2.drawStr(0, 62, "PLAYER 1");    
      u8g2.setFont(u8g2_font_fub20_tr);
      u8g2.drawStr(0, 92, "PLAYER 1");
    break;

    case 5:
      u8g2.setFont(u8g2_font_fub11_tr);
      u8g2.drawStr(0, 11, "PLAYER 1");
      u8g2.setFont(u8g2_font_fub14_tr);
      u8g2.drawStr(0, 35, "PLAYER 1");
      u8g2.setFont(u8g2_font_fub17_tr);
      u8g2.drawStr(0, 62, "PLAYER 1");    
      u8g2.setFont(u8g2_font_fub20_tr);
      u8g2.drawStr(0, 92, "PLAYER 1");  
      u8g2.setFont(u8g2_font_fub25_tr);
      u8g2.drawStr(0, 128, "PLAYER 1");
    break; 
  }
}

// Brainy-Bits logo array
const uint8_t  brainy_bitmap[] PROGMEM = {
0x00,0x00,0x00,0x00,0xe0,0x8f,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0xfc,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,
 0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0x0f,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0xe0,0x1f,0xf8,0xc0,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0xf0,0x07,0xf8,0x00,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0x03,0xf8,
 0x00,0xfe,0x0f,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0x03,0xf8,0x00,0xff,0x3f,
 0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0x0f,0xf8,0x80,0xff,0xff,0x00,0x00,0x00,
 0x00,0x00,0xfe,0xff,0x1f,0xf8,0xc0,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0xff,
 0xe1,0x3f,0xf8,0xe0,0x3f,0xfe,0x07,0x00,0x00,0x00,0x80,0x3f,0x00,0x3f,0xf8,
 0xf0,0x07,0xf0,0x07,0x00,0x00,0x00,0x80,0x1f,0x00,0x7e,0xf8,0xf0,0x01,0xc0,
 0x0f,0x00,0x00,0x00,0xc0,0x0f,0x00,0x7c,0xf8,0xf8,0x01,0x80,0x1f,0x00,0x00,
 0x00,0xe0,0x07,0x00,0xf8,0xf8,0xf8,0x00,0x00,0x1f,0x00,0x00,0x00,0xe0,0x03,
 0x00,0xf8,0xf8,0xf8,0x00,0x00,0x3e,0x00,0x00,0x00,0xe0,0x03,0x00,0xf8,0xf8,
 0x78,0x00,0x00,0x3e,0x00,0x00,0x00,0xf0,0x01,0x00,0xf8,0xf8,0x78,0x00,0x00,
 0x3e,0x00,0x00,0x00,0xf0,0x01,0x00,0xf8,0xf8,0x78,0x00,0x00,0x3c,0x00,0x00,
 0x00,0xf0,0x01,0x00,0xf8,0xf8,0xf8,0x00,0x00,0x7c,0x00,0x00,0x00,0xf0,0x01,
 0x00,0x7c,0xf8,0xf8,0x00,0x00,0x7c,0x00,0x00,0x00,0xf0,0x01,0x00,0x7c,0xf8,
 0xf0,0x01,0x00,0x7c,0x00,0x00,0x00,0xf0,0x01,0x00,0x7f,0xf8,0xf0,0x07,0x00,
 0x3c,0x00,0x00,0x00,0xf0,0x01,0x80,0x3f,0xf8,0xe0,0x0f,0x00,0x3c,0x00,0x00,
 0x00,0xf8,0x03,0x80,0x1f,0xf8,0xc0,0x0f,0x00,0xfe,0x00,0x00,0x00,0xfc,0x03,
 0x80,0x0f,0xf8,0x80,0x0f,0x00,0xfe,0x01,0x00,0x00,0xfe,0x07,0x00,0x03,0xf8,
 0x00,0x07,0x00,0xff,0x03,0x00,0x00,0xff,0x0f,0x00,0x00,0xf8,0x00,0x00,0x80,
 0xff,0x07,0x00,0x80,0xdf,0x1f,0x00,0x00,0xf8,0x00,0x00,0xc0,0xef,0x0f,0x00,
 0xc0,0x8f,0x3f,0x00,0x00,0xf8,0x00,0x00,0xe0,0x8f,0x0f,0x00,0xc0,0x07,0x7f,
 0x00,0x00,0xf8,0x00,0x00,0xf8,0x07,0x1f,0x00,0xe0,0x03,0xfe,0x03,0x00,0xf8,
 0x00,0x00,0xfe,0x03,0x1f,0x00,0xe0,0x03,0xfe,0x0f,0x00,0xf8,0x00,0xc0,0xff,
 0x01,0x3e,0x00,0xe0,0x01,0xf8,0x7f,0x00,0xf8,0x00,0xf8,0xff,0x00,0x3e,0x00,
 0xf0,0x01,0xf0,0xff,0x01,0xf8,0x00,0xfe,0x3f,0x00,0x3e,0x00,0xf0,0x01,0x80,
 0xff,0x07,0xf8,0x00,0xff,0x0f,0x00,0x3c,0x00,0xf0,0x01,0x00,0xfc,0x0f,0xf8,
 0x80,0xff,0x01,0x00,0x3c,0x00,0xf0,0x01,0x00,0xe0,0x1f,0xf8,0xc0,0x3f,0x00,
 0x00,0x3c,0x00,0xf0,0x81,0x01,0x80,0x1f,0xf8,0xe0,0x0f,0x00,0x0c,0x3c,0x00,
 0xf0,0xfd,0x1f,0x00,0x3f,0xf8,0xe0,0x07,0xc0,0xff,0x3c,0x00,0xe0,0xff,0x7f,
 0x00,0x3e,0xf8,0xf0,0x03,0xf0,0xff,0x3f,0x00,0xe0,0xff,0xff,0x00,0x7e,0xf8,
 0xf0,0x01,0xf8,0xff,0x3f,0x00,0xe0,0xff,0xff,0x01,0x7c,0xf8,0xf0,0x01,0xfc,
 0xff,0x3f,0x00,0xc0,0x1f,0xfc,0x03,0x7c,0xff,0xf7,0x01,0xfe,0xc0,0x1f,0x00,
 0xe0,0x07,0xe0,0x03,0xfc,0xff,0xff,0x00,0x3e,0x00,0x3f,0x00,0xf0,0x03,0xc0,
 0x03,0xf8,0xff,0xff,0x00,0x1e,0x00,0x7e,0x00,0xf0,0x01,0xc0,0x01,0xfc,0xff,
 0xff,0x00,0x1c,0x00,0x7c,0x00,0xf8,0x00,0x00,0x00,0xfe,0xff,0xff,0x03,0x00,
 0x00,0xf8,0x00,0xf8,0x00,0x00,0x00,0xff,0xf8,0xf8,0x07,0x00,0x00,0xf8,0x00,
 0x7c,0x00,0x00,0x80,0x3f,0xf8,0xf0,0x0f,0x00,0x00,0xf8,0x00,0x7c,0x00,0x00,
 0x80,0x1f,0xf8,0xc0,0x0f,0x00,0x00,0xf0,0x01,0x7c,0x00,0x00,0xc0,0x0f,0xf8,
 0x80,0x1f,0x00,0x00,0xf0,0x01,0x7c,0x00,0x00,0xe0,0x07,0xf8,0x00,0x3f,0x00,
 0x00,0xf0,0x01,0x3c,0x00,0x00,0xe0,0x03,0xf8,0x00,0x3e,0x00,0x00,0xf0,0x01,
 0x3c,0x00,0x00,0xf0,0x01,0xf8,0x00,0x3e,0x00,0x00,0xf0,0x01,0x7c,0x00,0x00,
 0xf0,0x01,0xf8,0x00,0x7c,0x00,0x00,0xf0,0x01,0x7c,0x00,0x00,0xf0,0x00,0xf8,
 0x00,0x7c,0x00,0x00,0xf0,0x01,0x7c,0x00,0x00,0xf8,0x00,0xf8,0x00,0x78,0x00,
 0x00,0xf0,0x01,0x7c,0x00,0x00,0xf8,0x00,0xf8,0x00,0xf8,0x00,0x00,0xf8,0x00,
 0xf8,0x00,0x00,0x7c,0x00,0xf8,0x00,0xf8,0x00,0x00,0xf8,0x00,0xf8,0x00,0x00,
 0x7c,0x00,0xf8,0x00,0xf0,0x01,0x00,0xfc,0x00,0xf0,0x01,0x00,0x3e,0x00,0xf8,
 0x00,0xf0,0x03,0x00,0x7c,0x00,0xf0,0x03,0x00,0x3f,0x00,0xf8,0x00,0xe0,0x07,
 0x00,0x7e,0x00,0xe0,0x0f,0xc0,0x1f,0x00,0xf8,0x00,0xc0,0x0f,0x80,0x3f,0x00,
 0xc0,0x3f,0xf0,0x0f,0x00,0xf8,0x00,0xc0,0x7f,0xe0,0x1f,0x00,0xc0,0xff,0xff,
 0x07,0x00,0xf8,0x00,0x80,0xff,0xff,0x1f,0x00,0xc0,0xff,0xff,0x03,0x00,0xf8,
 0x00,0x00,0xfe,0xff,0x1f,0x00,0xc0,0xff,0xff,0xc1,0x1f,0xf8,0xc0,0x1f,0xfc,
 0xff,0x1f,0x00,0xc0,0xfb,0x7f,0xf0,0x3f,0xf8,0xf0,0x7f,0xf0,0xff,0x1e,0x00,
 0xc0,0x03,0x00,0xf8,0x3f,0xf8,0xf0,0xff,0x00,0x00,0x1e,0x00,0xc0,0x03,0x00,
 0xfc,0x3f,0xf8,0xf0,0xff,0x01,0x00,0x1e,0x00,0xc0,0x03,0x00,0xfe,0x19,0xf8,
 0xe0,0xfc,0x03,0x00,0x1f,0x00,0xc0,0x03,0x00,0x3f,0x00,0xf8,0x00,0xf0,0x07,
 0x00,0x1f,0x00,0xc0,0x07,0x80,0x1f,0x00,0xf8,0x00,0xc0,0x07,0x00,0x1f,0x00,
 0xc0,0x07,0x80,0x0f,0x00,0xf8,0x00,0x80,0x0f,0x80,0x0f,0x00,0x80,0x0f,0x80,
 0x0f,0x00,0xf8,0x00,0x80,0x0f,0x80,0x0f,0x00,0x80,0x1f,0xc0,0x07,0x00,0xf8,
 0x00,0x80,0x0f,0xc0,0x0f,0x00,0x00,0x3f,0xc0,0x07,0x00,0xf8,0x00,0x00,0x1f,
 0xe0,0x07,0x00,0x00,0x3f,0xc0,0x07,0x00,0xf8,0x00,0x00,0x1f,0xf0,0x03,0x00,
 0x00,0xfe,0xc0,0x07,0x00,0xf8,0x00,0x00,0x1f,0xf8,0x03,0x00,0x00,0xfc,0xc3,
 0x07,0x00,0xf8,0x00,0x00,0x1f,0xfe,0x01,0x00,0x00,0xf8,0xdf,0x07,0x00,0xf8,
 0x00,0x00,0xdf,0xff,0x00,0x00,0x00,0xf0,0xff,0x07,0x00,0xf8,0x00,0x80,0xff,
 0x7f,0x00,0x00,0x00,0xe0,0xff,0x0f,0x00,0xf8,0x00,0x80,0xff,0x1f,0x00,0x00,
 0x00,0x80,0xff,0x1f,0x00,0xf8,0x00,0xc0,0xff,0x07,0x00,0x00,0x00,0x00,0xfc,
 0x3f,0x00,0xf8,0x00,0xf0,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0xfe,0x00,0xfe,
 0x01,0xf8,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0x01,
 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0xf0,0xff,0xdf,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0xc0,0xff,0x8f,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x03,
 0xfe,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0xc0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0xc0,0xff,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xc3,
 0x3f,0x00,0x03,0x3c,0x04,0x38,0x06,0x0e,0x00,0xc0,0xff,0xc7,0xff,0x80,0x03,
 0x3c,0x1c,0x38,0x1f,0x0f,0x00,0xc0,0xff,0xcf,0xfb,0x80,0x07,0x3c,0x3c,0x38,
 0x9f,0x0f,0x00,0xc0,0xcf,0xcf,0xf3,0xc0,0x0f,0x3c,0x7c,0x38,0xbe,0x0f,0x00,
 0xc0,0xcf,0xcf,0xf3,0xc0,0x0f,0x3c,0xfc,0x38,0xfc,0x03,0x00,0xc0,0x8f,0xcf,
 0x73,0xe0,0x1e,0x3c,0xfc,0x3b,0xf8,0x01,0x00,0xc0,0xcf,0xcf,0x3b,0xf0,0x1e,
 0x3c,0xfc,0x3f,0xf0,0x01,0x00,0xc0,0xcf,0xcf,0x7b,0x70,0x3c,0x3c,0xde,0x3f,
 0xf0,0x00,0x00,0xc0,0xcf,0xcf,0xfb,0xf8,0x7f,0x3c,0x9e,0x3f,0xf0,0x00,0x00,
 0xc0,0xef,0xc7,0xf3,0xf9,0x7f,0x3c,0x1e,0x3e,0xf0,0x00,0x00,0xc0,0xff,0xc3,
 0xe3,0xfd,0xff,0x3c,0x1e,0x3c,0xf0,0x00,0x00,0xc0,0xff,0xc1,0xe3,0x3d,0xf0,
 0x3c,0x1e,0x38,0xf0,0x00,0x00,0xc0,0xff,0xc7,0xc3,0x18,0x30,0x3c,0x1e,0x10,
 0xf0,0x00,0x00,0xc0,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0xc0,0xcf,0xdf,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x8f,0xdf,
 0xf3,0x7f,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x8f,0xdf,0xf3,0x7f,0x3f,
 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x8f,0xdf,0x83,0x87,0x07,0x00,0x00,0x00,
 0x00,0x00,0x00,0xc0,0x8f,0xdf,0x83,0x87,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,
 0xc0,0x8f,0xdf,0x83,0x87,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xcf,0xcf,
 0x83,0x07,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xcf,0x83,0x07,0x7c,
 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xc7,0x83,0x07,0x78,0x00,0x00,0x00,
 0x00,0x00,0x00,0xc0,0xff,0xc3,0x83,0x87,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,
 0xc0,0xff,0xc1,0x83,0x87,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x3f,0xc0,
 0x83,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };



void loop(void) {

  if (digitalRead(switch_pin) == LOW) {  // check if switch is pressed
    if (loop_pass <= 5) {  // Display Text until variable is greater than 5
      u8g2.clearBuffer();  // Clear Oled display
      drawText();
      u8g2.sendBuffer();   // Update Oled display
      loop_pass++;
    } else {
      u8g2.clearBuffer();
      u8g2.drawXBMP( 21, 0, 90, 125, brainy_bitmap);  // Display Brainy-Bits logo
      u8g2.sendBuffer();
      loop_pass=1;     
    }
    delay(50);  // Small delay for debouncing the switch
  }
}
 

CONCLUSION


After some testing, I can say that I really like this OLED display.


The 128×128 resolution is great and means that you can rotate the display in any orientation you want to fit your project since it’s basically a square.


The price is cheap enough to use in many projects, and as you saw it’s pretty easy to use using the U8g2 library.


I will be making more tutorials about this OLED display in the near future, so stay tuned.

 

TUTORIAL VIDEO




 

DOWNLOAD


Copy and Paste the above code/sketch in your Arduino IDE software.


Link to the U8g2 library here:


Link to the LCD Image Converter here:

8,629 views

Recent Posts

See All

All my content is and will always be Free.

If you feel that my Videos / Tutorials are helping, and you would like to contribute...

 You can toss some coins in the Tip Jar via PayPal.

Select amount then click the “Donate” button.

bottom of page