SSD1306 + ESP32: Hello Screen in 10 Minutes
What you need
- XK-OLED-096-YB — 0.96” I2C OLED (yellow & blue)
- Any ESP32 dev board (the C3 Super Mini works great)
- 4 jumper wires
Wiring
| OLED pin | ESP32 |
|---|---|
| VCC | 3V3 |
| GND | GND |
| SCL | GPIO 22 |
| SDA | GPIO 21 |
Code
Install Adafruit SSD1306 and Adafruit GFX from the Arduino Library Manager, then flash:
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display(128, 64, &Wire, -1);
void setup() {
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 0);
display.println("Hello, DooMaker!");
display.display();
}
void loop() {}
Power it up and your first line is on the glass — that’s the whole tutorial.
Common pitfalls
- Nothing shows: roughly a third of modules ship with address
0x3Dinstead of0x3C. Swap it and retry. - Garbage pixels: run an I2C scanner sketch first to confirm the address before blaming the panel.
- ESP32-C3 Super Mini: its default I2C pins differ — use
Wire.begin(5, 6);beforedisplay.begin()(SDA=5, SCL=6).