Nash Ali
Published © GPL3+

ESP32/ESP8266 Dual OLEDs

One 128 x 64 i2c display hooked up to an ESP32/ESP8266 is ok, but two adds a whole new dimension to Microcontrollers.

IntermediateProtip1 hour3,759
ESP32/ESP8266 Dual OLEDs

Things used in this project

Hardware components

0.96" OLED 64x128 Display Module
ElectroPeak 0.96" OLED 64x128 Display Module
Requires desoldering a jumper.
×2
ESP8266 ESP-12E
Espressif ESP8266 ESP-12E
These come in all varieties
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Schematics

Dual Display

My Configuration

Code

Dual Display

C/C++
Create a new Arduino project an paste file into the new project.
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>

Adafruit_SSD1306 display1(-1);
Adafruit_SSD1306 display2(-1);
// this is the default address of the display(0x78) on back of display
#define OLED1 0x3C
// this is after switching over the jumper.
#define OLED2 0x3D
int i, j;

void setup()   {
  display1.begin(SSD1306_SWITCHCAPVCC, OLED1);
  display1.clearDisplay();
  display1.display();
  display2.begin(SSD1306_SWITCHCAPVCC, OLED2);
  display2.clearDisplay();
  display2.display();
}


void loop() {

  for (int i = 0; i < 270; i+=10) {

    display1.setTextSize(1);
    display1.setTextColor(WHITE);
    display1.setCursor(0, 0 );
    display1.println("Display 1");
    display1.fillCircle(i, 30,  5, 1);
    display1.display();
    display1.clearDisplay();

    display2.setTextSize(1);
    display2.setTextColor(WHITE);
    display2.setCursor(0, 0);
    display2.println("Display 2");
    display2.fillCircle(i - 127, 30,  5, 1);
    display2.display();
    display2.clearDisplay();
  }
  

}

Credits

Nash Ali

Nash Ali

13 projects • 13 followers
Put together a transistor radio by "Heathkit" when I was around 10, fell in love with electronics and has been a hobby ever since.

Comments