#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);
void setup() {
if (!display.begin(SSD1306_ADDRESS, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for (;;);
}
display.display();
delay(2000);
display.clearDisplay();
}
void loop() {
display.setTextSize(1); // Set font size (1 to 8)
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 0); // Set text position
display.println(F("Hello, Wokwi!")); // Print your message
display.display(); // Update the display
delay(1000); // Wait for a second
}