Hi everyone,
I'm using a 1.3" OLED display (I2C, SSD1306 driver, 128x64 resolution) with an Arduino Uno. I followed the standard wiring and used the Adafruit SSD1306 and GFX libraries, but nothing is showing up on the screen — not even the Adafruit splash screen.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); // -1 = no reset pin
void setup() {
Serial.begin(9600);
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // 0x3C is the common I2C address
Serial.println(F("SSD1306 allocation failed"));
for (;;);
}
delay(2000);
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 0);
display.println(F("Hello, VJ!"));
display.println(F("1.3 inch OLED"));
display.display();
}
void loop() {
// nothing here
}
Wiring:
- VCC → 3.3V
- GND → GND
- SDA → A4
- SCL → A5
What I've tried:
- Verified all wiring
- Used different OLEDs and jumper wires
- Checked I2C address with I2C scanner (it returns 0x3C correctly)
- Tried other example sketches like
ssd1306_128x64_i2c
from the Adafruit library
Still no display output.
Any ideas on what might be going wrong? Could this be a library issue, a contrast setting, or something I'm overlooking?