#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h> // For OLED
// #include <Adafruit_ILI9341.h> // For TFT
// OLED display dimensions
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
// Declare the display object
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
void setup() {
// put your setup code here, to run once:
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;);
}
display.clearDisplay();
// Call functions to draw shapes here
// Drawing various shapes
display.drawLine(0, 0, 127, 63, WHITE);
display.drawRect(10, 10, 50, 30, WHITE);
display.drawCircle(90, 30, 20, WHITE);
display.drawTriangle(10, 10, 50, 50, 10, 50, WHITE);
display.drawLine(0, 63, 127, 0, WHITE);
}
void loop() {
// put your main code here, to run repeatedly:
display.display();
}