SSD1306 OLED Display
Wiring
| OLED Pin | Arduino Pin |
|---|---|
| VCC | 3.3V |
| GND | GND |
| SDA | A4 |
| SCL | A5 |
Code
Install Adafruit SSD1306 + Adafruit GFX libraries.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display(128, 64, &Wire);
void setup() {
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
display.setTextSize(2); display.setTextColor(WHITE);
display.setCursor(10, 20); display.println("Hello!");
display.display();
}
void loop() {}
Specifications
- Resolution: 128×64
- I2C address: 0x3C (default)
- Color: White or Blue
Troubleshooting
- Blank screen — I2C address may be 0x3D on some modules
- Garbled display — Check SDA/SCL wiring, add 4.7k pull-up if long wires