#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
#define SCREEN_ADDRESS 0x3C
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup() {
// Initialize with the I2C addr 0x3D (for the 128x64)
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;);
}
// Clear the buffer
display.clearDisplay();
// Draw two lines in the upper right side
display.drawLine(100, 2, 127, 2, WHITE);
display.drawLine(105, 6, 127, 6, WHITE);
// Draw two vertical lines
display.drawLine(100, 3, 100, 8, WHITE);
display.drawLine(105, 7, 105, 8, WHITE);
// Display
display.display();
}
void loop() {
// Nothing here
}