Arduino UnoMedium
Smart I2C OLED Display
Draw custom texts, labels, and borders on a standard 128x64 SSD1306 OLED screen using standard I2C buses.
Target AI Prompt
"Write Hello World text to SSD1306 128x64 OLED display using I2C."
Hardware Connections
OLED VCCPower pin
5VOLED GNDGround pin
GNDOLED SDAI2C Data pin (Arduino Uno)
A4OLED SCLI2C Clock pin (Arduino Uno)
A5Logic Explanation
Initializes the Adafruit SSD1306 helper class at address 0x3C. It clears the internal screen buffer, positions the cursor, draws the text pixels, and commits the changes using display.display().
Verified AuthorEmbedino Hardware FleetVerified expert compilation & hardware validation.
main.cpp
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup() {
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
for(;;); // Loop forever if display initialization fails
}
display.clearDisplay();
display.setTextSize(1.5);
display.setTextColor(SSD1306_WHITE);
display.setCursor(10, 24);
display.println("HELLO WORLD");
display.display();
}
void loop() {
// Static screen display
}Compile & Flash Online
Connect your Arduino and flash this exact example directly inside our web console.
Launch App Workspace →