#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display(128, 64, &Wire, -1);
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
void setup() {
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.setTextColor(SSD1306_WHITE);
display.clearDisplay();
}
int CurrentValue = 100; // Default light value
void loop() {
// Light title, fully highlighted across the width
display.setTextColor(BLACK, WHITE); // Inverted text
display.fillRect(0, 0, SCREEN_WIDTH, 10, WHITE); // Full-width highlight (128px wide, 10px tall)
display.setCursor(0, 0);
display.print(" Light");
// UP arrow and text
display.fillTriangle(120, 18, 128, 18, 124, 10, WHITE); // Triangle pointing up
display.setCursor(60, 12); // Adjusted for alignment
display.setTextColor(WHITE);
display.print("Increase");
// DOWN arrow and text
display.fillTriangle(120, 54, 128, 54, 124, 62, WHITE); // Triangle pointing down
display.setCursor(60, 50);
display.print("Decrease");
// BACK arrow and text
display.fillTriangle(0, 59, 5, 64, 5, 54, WHITE); // Left arrow
display.setCursor(10, 54);
display.print("Back");
// Center value
display.setTextSize(2); // Larger size
display.setCursor((SCREEN_WIDTH - (String(CurrentValue).length() * 12)) / 2, 30);
display.print(CurrentValue);
display.setTextSize(1); // Reset text size
display.display();
delay(500);
}