IOT

How to Interface OLED Display with NodeMCU ESP8266?

In this guide, we’ll show you how to connect an SSD1306 OLED display to an ESP8266. The OLED display in question is a 7 Pin SPI kind. We will therefore substitute a NodeMCU development board for the standard ESP-01 Module. We will learn the pins required for connecting an OLED Display to an ESP8266 NodeMCU, display a bitmap image, and comprehend how the OLED Display interface on the NodeMCU functions.

I created a tutorial specifically for interfacing an OLED display with an ESP32 development board. Look into it.

ESP8266-OLED

Introduction

The display technology known as Organic Light Emitting Diode, or OLED for short, is quite common in televisions and mobile phones. OLED Displays are capable of producing their own backlight at the pixel level. In contrast, LCD displays need a separate backlight to illuminate the panel.

Speaking of contrast, each pixel has its own light source, which can be shut off to create a completely dark image. As a result, an OLED Display has a substantially higher contrast ratio than an ordinary LCD.

OLED displays are also common in battery-operated gadgets like Smart Watches, Health Trackers, and other wearables due to their lower power consumption (only pixels that are lit up receive electricity).

SSD1306 OLED Display

There are a few OLED Displays on the market that are suitable for do-it-yourself applications; they typically have a resolution of 12864 or 12832 pixels. Additionally, OLED Displays can be divided into two categories based on the communication interface they offer. I2C is used by one type and SPI by the other.

SPI-OLED-Display-Module-Front-Back

An SPI type OLED Display with a 12864 pixel resolution and a 0.96″ diagonal size will be used in this project. The SSD1306 OLED Driver IC is the foundation of this OLED display.

It’s important to keep in mind that the SSD1306 OLED Driver IC can be set up to communicate via either the SPI interface or the I2C interface. Therefore, the identical OLED Panel and OLED Driver IC can produce two different devices: one with four I2C pins and the other with seven SPI pins.

SPI-OLED-Display-Pinout

In fact, by simply soldering or de-soldering any SMD resistors, you can even change one kind to another.

Identifying SPI Pins in ESP8266 NodeMCU

This particular OLED is of the SPI variety, as was previously indicated. Therefore, we must look for and set up SPI pins in the ESP8266. We will use the NodeMCU Development Board because the ESP-01 Module does not fanout all of the pins of the ESP8266EX SoC.

If you recall from the instruction on ESP8266 NodeMCU Pinout, it has two SPI interfaces: SPI and HSPI. However, the ESP8266EX SoC already uses the SPI protocol to communicate to the SPI Flash IC in the ESP-12E Module.

So, the HSPI interface is all that is left.

NodeMCU-Pinout-Image

Look at the ESP8266 NodeMCU’s pinout diagram to see what the HSPI pins are:

HSPI GPIO NodeMCU
HSPI_MISO GPIO 12 D6
HSPI_MOSI GPIO 13 D7
HSPI_CLK GPIO 14 D5
HSPI_CS GPIO 15 D8

ESP8266 NodeMCU OLED Display Interface

As soon as the ESP8266 NodeMCU’s SPI pins are known, we can begin connecting an OLED display to it. However, there are two additional pins in addition to the SPI pins on the SPI OLED Display pinout.

They are the DC (Data/Command) and RST (Reset) pins. Since GPIO 4 (D2) and GPIO 5 (D1) of the ESP8266 NodeMCU are free and these pins are only control pins, let’s use them for this purpose.

The connection between the ESP8266 NodeMCU and SPI OLED Display so appears to be as follows:

OLED Display ESP8266 NodeMCU
GND GND
VCC 3.3V
D0 (SCK / CLK) GPIO 14 (D5)
D1 (MOSI) GPIO 13 (D7)
RES GPIO 4 (D2)
DC GPIO 5 (D1)
CS GPIO 15 (D8)

Components Required

  • ESP8266 NodeMCU Development Board
  • OLED Display
  • Breadboard
  • Connecting Wires
  • Micro-USB Cable

Circuit Diagram

The circuit diagram for the ESP8266 NodeMCU OLED Display Interface may be seen in the picture below. The SPI OLED Display requires this particular circuit.

ESP8666-NodeMCU-OLED-Display-Circuit

Preparing Arduino IDE

Let me go over those processes again. If you worked with OLED Displays (either I2C or SPI type) before, then you probably would have obtained the required libraries for Arduino IDE.

You must specifically download two libraries. One is for the SSD1306 OLED Driver, and the other is for showing some simple graphics.

Open the Arduino IDE, then choose Tools -> Manage Libraries to access the library management. . . Install the “Adafruit SSD1306 library” and perform a search for “ssd1306”. The picture shows that I’ve already installed it.

ESP8266-OLED-Arduino-IDE-1
ESP8266-OLED-Arduino-IDE-2

Next, search for ‘gfx’ and install ‘Adafruit GFX’ library. After this, close the library manager.

ESP8266-OLED-Arduino-IDE-3

Ensure that the NodeMCU board is chosen. If not, pick this board by clicking NodeMCU 1.0 under Tools -> Board -> ESP8266 Boards (ESP-12E Module). Additionally, choose the proper COM Port (if you already made the connections and connected NodeMCU to the computer).

ESP8266-OLED-Arduino-IDE-4

We are now ready to use the OLED Display to show some content.

Displaying Text

First, we’ll create a little programme that displays some essential text-related data. Simple text, inverted text, scrolling text, ASCII characters, and two font sizes are all included in this.

Code

  #include <SPI.h>
  #include <Wire.h>
  #include <Adafruit_GFX.h>
  #include <Adafruit_SSD1306.h>
   
  #define SCREEN_WIDTH 128
  #define SCREEN_HEIGHT 64
   
  #define OLED_MOSI   13
  #define OLED_CLK   14
  #define OLED_DC    5
  #define OLED_CS    15
  #define OLED_RESET 4
  Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT,
  OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
   
  void setup()
  {
  Serial.begin(115200);
  if(!display.begin(SSD1306_SWITCHCAPVCC))
  {
    Serial.println(F(“SSD1306 allocation failed”));
    for(;;);
  }
   
  display.clearDisplay();
  display.display();
  delay(100);
  }
   
  void loop()
  {
  AllPixels();
  TextDisplay();
  InvertedTextDisplay();
  ScrollText();
  DisplayChars();
  TextSize();
   
  void AllPixels()
  {
  int i;
  int j;
  display.clearDisplay();
  for(i=0;i<128;i++)
  {
    for(j=0;j<64;j++)
    {
      display.drawPixel(i, j, SSD1306_WHITE);
      
    }
    display.display();
    delay(20);
  }
   
  for(i=0;i<128;i++)
  {
    for(j=0;j<64;j++)
    {
      display.drawPixel(i, j, SSD1306_BLACK);
      
    }
    display.display();
    delay(20);
  }
   
  }
   
  void TextDisplay()
  {
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(5,28);
  display.println(“Electronics Hub”);
  display.display();
  delay(3000);
  }
   
  void InvertedTextDisplay()
  {
  display.clearDisplay();
  display.setTextColor(SSD1306_BLACK, SSD1306_WHITE);
  display.setCursor(5,28);
  display.println(“Electronics Hub”);
  display.display();
  delay(3000);
  }
   
  void ScrollText()
  {
  display.clearDisplay();
  display.setCursor(0,0);
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.println(“This is a”);
  display.println(“Scrolling”);
  display.println(“Text!”);
  display.display();
  delay(100);
  display.startscrollright(0x00, 0x0F);
  delay(2000);
  //display.stopscroll();
  //delay(1000);
  display.startscrollleft(0x00, 0x0F);
  delay(2000);
  //display.stopscroll();
  //delay(1000);
  display.startscrolldiagright(0x00, 0x0F);
  delay(2000);
  display.startscrolldiagleft(0x00, 0x0F);
  delay(2000);
  display.stopscroll();
  }
   
  void DisplayChars()
  {
  display.clearDisplay();
   
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);
  display.cp437(true);
   
  for(int16_t i=0; i<256; i++)
  {
    if(i == ‘\n’)
    {
      display.write(‘ ‘);
    }
    else
    {
      display.write(i);
    }
  }
   
  display.display();
  delay(3000);
  }
  void TextSize()
  {
  display.clearDisplay();
   
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0,0);
  display.println(F(“Size: 1”));
  display.println(F(“ABC”));
   
  display.setTextSize(2);
  display.setTextColor(SSD1306_WHITE);
  display.println(“Size: 2”);
  display.println(F(“ABC”));
   
  display.display();
  delay(3000);
  }
ESP8266-OLED-Text

Displaying Graphics

The GFX library will then be used to display some simple forms, such as rectangles, filled rectangles, rounds, filled round rectangles, circles, filled circles, triangles, and filled triangles.

Code

  #include <SPI.h>
  #include <Wire.h>
  #include <Adafruit_GFX.h>
  #include <Adafruit_SSD1306.h>
   
  #define SCREEN_WIDTH 128
  #define SCREEN_HEIGHT 64
   
  #define OLED_MOSI   13
  #define OLED_CLK   14
  #define OLED_DC    5
  #define OLED_CS    15
  #define OLED_RESET 4
  Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT,
  OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
   
  void setup()
  {
  Serial.begin(115200);
  if(!display.begin(SSD1306_SWITCHCAPVCC))
  {
    Serial.println(F(“SSD1306 allocation failed”));
    for(;;);
  }
   
  display.clearDisplay();
  display.display();
  delay(100);
  }
   
  void loop()
  {
  DrawRectangle();
  DrawFilledRectangle();
  DrawRoundRectangle();
  DrawFilledRoundRectangle();
  DrawCircle();
  DrawFilledCircle();
  DrawTriangle();
  DrawFilledTriangle();
  }
   
   
  void DrawRectangle()
  {
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println(“Rectangle”);
  display.drawRect(0, 15, 90, 45, SSD1306_WHITE);
  display.display();
  delay(2000);
  }
   
  void DrawFilledRectangle()
  {
  display.clearDisplay(); 
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println(“Filled Rectangle”);
  display.fillRect(0, 15, 90, 45, SSD1306_WHITE);
  display.display();
  delay(2000);
   
  }
   
  void DrawRoundRectangle()
  {
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0,0);
  display.println(“Round Rectangle”);
  display.drawRoundRect(0, 15, 90, 45, 10, SSD1306_WHITE);
  display.display();
  delay(5000);
  }
   
  void DrawFilledRoundRectangle()
  {
  display.clearDisplay(); 
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0,0);
  display.println(“Filled Round Rect”);
  display.fillRoundRect(0, 15, 90, 45, 10, SSD1306_WHITE);
  display.display();
  delay(2000);
   
  }
   
  void DrawCircle()
  {
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0,0);
  display.println(“Circle”);
  display.drawCircle(30, 36, 25, SSD1306_WHITE);
  display.display();
  delay(2000);
  }
  void DrawFilledCircle()
  {
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0,0);
  display.println(“Filled Circle”);
  display.fillCircle(30, 36, 25, SSD1306_WHITE);
  display.display();
  delay(2000);
   
  }
   
  void DrawTriangle()
  {
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0,0);
  display.println(“Triangle”);
  display.drawTriangle(30, 15, 0, 60, 60, 60, SSD1306_WHITE);
  display.display();
  delay(2000); 
  }
   
  void DrawFilledTriangle()
  {
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0,0);
  display.println(“Filled Triangle”);
  display.fillTriangle(30, 15, 0, 60, 60, 60, SSD1306_WHITE);
  display.display();
  delay(2000);
  }
ESP8266-OLED-Graphics

Displaying Bitmap Image

Finally, let’s create equivalent bytecode for a little bitmap image to show off the SSD1306 OLED Display’s capabilities to display bitmaps (using tools like GIMP or any online tool).

To display the image on the OLED Display, we must incorporate this byte code into our code and use the ‘drawBitmap’ method.

Code

  #include <SPI.h>
  #include <Wire.h>
  #include <Adafruit_GFX.h>
  #include <Adafruit_SSD1306.h>
   
  #define SCREEN_WIDTH 128
  #define SCREEN_HEIGHT 64
   
  #define OLED_MOSI   13
  #define OLED_CLK   14
  #define OLED_DC    5
  #define OLED_CS    15
  #define OLED_RESET 4
  Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT,
  OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
   
  const unsigned char electronicshub_logo [] PROGMEM = {
  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, 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, 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, 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, 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, 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, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0x80,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0x80,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0x80,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0x80,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0x80,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0x80,
  0x03, 0xe0, 0x07, 0xc3, 0x87, 0xcf, 0x03, 0x02, 0x11, 0x07, 0x04, 0x0f, 0xbd, 0xbd, 0xc7, 0x80,
  0x03, 0xe4, 0x07, 0xc3, 0xc7, 0xcf, 0x07, 0x82, 0x11, 0x07, 0x8e, 0x0f, 0xbd, 0xbd, 0xc7, 0x80,
  0x02, 0x04, 0x04, 0x06, 0xc1, 0x01, 0x84, 0xc2, 0x11, 0x0d, 0x8a, 0x0f, 0xbd, 0xbd, 0xf3, 0x80,
  0x02, 0x04, 0x04, 0x04, 0x61, 0x00, 0x88, 0x42, 0x11, 0x08, 0x8a, 0x0f, 0xbd, 0xbd, 0xfb, 0x80,
  0x02, 0x04, 0x04, 0x0c, 0x21, 0x00, 0x88, 0x43, 0x11, 0x10, 0x08, 0x0f, 0xbd, 0xbd, 0xfb, 0x80,
  0x02, 0x04, 0x04, 0x08, 0x01, 0x00, 0x88, 0x23, 0x11, 0x10, 0x08, 0x0f, 0xbd, 0xbd, 0xfb, 0x80,
  0x02, 0x04, 0x04, 0x08, 0x01, 0x00, 0x88, 0x23, 0x11, 0x10, 0x08, 0x0f, 0xbd, 0xbd, 0xfb, 0x80,
  0x02, 0x04, 0x04, 0x08, 0x01, 0x00, 0x90, 0x23, 0x11, 0x10, 0x08, 0x0f, 0xbd, 0xbd, 0xfb, 0x80,
  0x02, 0x04, 0x04, 0x08, 0x01, 0x00, 0x90, 0x22, 0x91, 0x10, 0x08, 0x0f, 0xbd, 0xbd, 0xf7, 0x80,
  0x02, 0x04, 0x04, 0x08, 0x01, 0x00, 0x90, 0x22, 0x91, 0x10, 0x0e, 0x0f, 0xbd, 0xbd, 0xc7, 0x80,
  0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x90, 0x22, 0x91, 0x10, 0x06, 0x0f, 0x81, 0xbd, 0xc7, 0x80,
  0x03, 0x84, 0x07, 0x08, 0x01, 0x07, 0x90, 0x22, 0xd1, 0x10, 0x03, 0x0f, 0x81, 0xbd, 0xf7, 0x80,
  0x02, 0x04, 0x04, 0x08, 0x01, 0x07, 0x10, 0x22, 0x51, 0x10, 0x01, 0x0f, 0xbd, 0xbd, 0xfb, 0x80,
  0x02, 0x04, 0x04, 0x08, 0x01, 0x06, 0x10, 0x22, 0x51, 0x10, 0x01, 0x0f, 0xbd, 0xbd, 0xfb, 0x80,
  0x02, 0x04, 0x04, 0x08, 0x01, 0x02, 0x10, 0x22, 0x51, 0x10, 0x01, 0x0f, 0xbd, 0xbd, 0xfb, 0x80,
  0x02, 0x04, 0x04, 0x08, 0x01, 0x02, 0x08, 0x22, 0x31, 0x10, 0x01, 0x0f, 0xbd, 0xbd, 0xfb, 0x80,
  0x02, 0x04, 0x04, 0x08, 0x01, 0x01, 0x08, 0x22, 0x31, 0x10, 0x01, 0x0f, 0xbd, 0xbd, 0xfb, 0x80,
  0x02, 0x04, 0x04, 0x0c, 0x21, 0x01, 0x08, 0x42, 0x31, 0x10, 0x01, 0x0f, 0xbd, 0xdb, 0xfb, 0x80,
  0x02, 0x04, 0x04, 0x04, 0x61, 0x01, 0x88, 0x42, 0x31, 0x08, 0x99, 0x0f, 0xbd, 0xdb, 0xf3, 0x80,
  0x02, 0x04, 0x04, 0x06, 0xc1, 0x00, 0x84, 0xc2, 0x11, 0x0d, 0x8b, 0x0f, 0xbd, 0xc3, 0xc7, 0x80,
  0x03, 0xe7, 0xc7, 0xc3, 0xc1, 0x00, 0x87, 0x82, 0x11, 0x07, 0x8e, 0x0f, 0xbd, 0xe7, 0xc7, 0x80,
  0x03, 0xe7, 0xc7, 0xc3, 0x81, 0x00, 0x83, 0x02, 0x11, 0x07, 0x06, 0x0f, 0xff, 0xff, 0xff, 0x80,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0x80,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0x80,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0x80,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0x80,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0x80,
  0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80,
  0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80,
  0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x07, 0xf0, 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, 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, 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, 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 setup()
  {
  Serial.begin(115200);
  if(!display.begin(SSD1306_SWITCHCAPVCC))
  {
    Serial.println(F(“SSD1306 allocation failed”));
    for(;;);
  }
   
  display.clearDisplay();
  display.display();
  delay(100);
   
  display.clearDisplay();
  display.drawBitmap(0, 0, electronicshub_logo, SCREEN_WIDTH, SCREEN_HEIGHT, SSD1306_WHITE);
  display.display();
  //delay(5000);
   
  }
   
  void loop()
  {
   
  }
ESP8266-OLED-Bitmap

Conclusion

I hope all of you had understand the basics of simple  ESP8266 NodeMCU OLED Display Interface. We MATHA ELECTRONICS will be back soon with more informative blogs soon.

Leave a Reply

Your email address will not be published. Required fields are marked *