#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1 // No reset pin used
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup() {
// Start I2C communication on GPIO 12 (SDA) and GPIO 14 (SCL)
Wire.begin(12, 14); // SDA = GPIO 12 (D12), SCL = GPIO 14 (D14)
// Initialize the display with the correct I2C address (0x3C)
if(!display.begin(0x3C, OLED_RESET)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;);
}
display.clearDisplay();
// Display text
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 0);
display.println(F("Hello, ESP8266!"));
display.display();
}
void loop() {
// Additional logic can go here
}