#include #include #include #define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 64 // OLED display height, in pixels // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) #define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin) #define SCREEN_ADDRESS 0x3C // I2C address for the OLED display Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); void setup() { // Initialize the display if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) { Serial.println(F("SSD1306 allocation failed")); for (;;); } // Clear the display buffer display.clearDisplay(); // Set text size and color display.setTextSize(2); // Increase text size display.setTextColor(SSD1306_WHITE); // Set cursor position display.setCursor(10, 25); // Display "Hello, World!" display.println("Hello, World!"); // Show the buffer on the display display.display(); } void loop() { // Nothing to do here }