#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup()
{
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
// ----- 왼쪽 공식 그림 -----
int x_offset = -28; // 왼쪽으로 이동 (조정 가능)
int cx = 64 + x_offset, cy = 32, r = 30;
display.drawCircle(cx, cy, r, SSD1306_WHITE);
// T자 형태로 공간 분할 (원 안에)
display.drawLine(cx - 29, cy, cx + 29, cy, SSD1306_WHITE); // 수평선
display.drawLine(cx, cy, cx, cy + 30, SSD1306_WHITE); // 수직선
// 각 영역에 V, I, R 표시 (원 안, T자 기준)
display.setTextSize(2);
display.setTextColor(SSD1306_WHITE);
display.setCursor(cx - 5, cy - 20); // V: T 윗부분 중앙
display.print("V");
display.setCursor(cx - 15, cy + 5); // I: T 왼쪽 아래
display.print("I");
display.setCursor(cx + 7, cy + 5); // R: T 오른쪽 아래
display.print("R");
// ----- 오른쪽 W/V/A 박스 -----
int box_height = 20;
int box_width = 24;
int box_x_offset = -5; // 박스 전체의 좌우 위치 조정
int text_x_offset = 7; // 글자의 좌우 위치 조정 (박스 기준)
int text_y_offset = 2; // 글자의 위아래 위치 조정 (박스 기준)
int x = SCREEN_WIDTH - box_width - 4 + box_x_offset;
int y_top = 2;
int y_mid = y_top + box_height;
int y_bot = y_mid + box_height;
display.drawRect(x, y_top, box_width, box_height, SSD1306_WHITE);
display.setCursor(x + text_x_offset, y_top + text_y_offset);
display.print("W");
display.drawRect(x, y_mid, box_width, box_height, SSD1306_WHITE);
display.setCursor(x + text_x_offset, y_mid + text_y_offset);
display.print("V");
display.drawRect(x, y_bot, box_width, box_height, SSD1306_WHITE);
display.setCursor(x + text_x_offset, y_bot + text_y_offset);
display.print("A");
display.display();
}
void loop()
{
// Nothing to do here
}