#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#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 4 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
const unsigned char PROGMEM trophy0 [] = {0x00, 0x00, 0x00, 0x01, 0xFF, 0xF3, 0x41, 0x62, 0x82, 0x87, 0x07, 0x07, 0x1C, 0x0E, 0x38, 0x0C, 0x60, 0x0F, 0x80, 0x0E, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00};
void setup() {
Serial.begin(9600);
// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3D)) { // Address 0x3D for 128x64
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
}
void loop() {
structure();
}
void structure() {
display.clearDisplay();
display.drawRect(14, 17, 101, 45, WHITE);
display.drawLine(34, 17, 34, 60, WHITE);
display.drawLine(54, 17, 54, 32, WHITE);
display.drawLine(74, 17, 74, 32, WHITE);
display.drawLine(94, 17, 94, 60, WHITE);
display.drawLine(54, 47, 54, 60, WHITE);
display.drawLine(74, 47, 74, 60, WHITE);
display.drawLine(14, 32, 113, 32, WHITE);
display.drawLine(14, 47, 113, 47, WHITE);
display.setTextColor(SSD1306_WHITE);
display.setTextSize(1);
display.setCursor(22, 21);
display.print("A");
display.setCursor(42, 21);
display.print("B");
display.setCursor(62, 21);
display.print("C");
display.setCursor(82, 21);
display.print("D");
display.setCursor(102, 21);
display.print("E");
display.setCursor(102, 36);
display.print("F");
display.setCursor(102, 51);
display.print("G");
display.setCursor(82, 51);
display.print("H");
display.setCursor(62, 51);
display.print("I");
display.setCursor(42, 51);
display.print("J");
display.setCursor(22, 51);
display.print("K");
display.setCursor(22, 36);
display.print("L");
display.display();
}