#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Wire.h>
// Screen dimensions
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
// OLED reset pin (you can set this to -1 if not using a reset pin)
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
// 'nav3', 32x32px, navigation icon
const unsigned char epd_bitmap_nav3 [] PROGMEM = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xc0, 0x03, 0xff, 0xff, 0x80, 0x01, 0xff,
0xff, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x00, 0x7f, 0xfc, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x3f,
0xf8, 0x01, 0x80, 0x1f, 0xf8, 0x03, 0xe0, 0x1f, 0xf8, 0x07, 0xe0, 0x1f, 0xf8, 0x0f, 0xf0, 0x1f,
0xf8, 0x0f, 0xf0, 0x1f, 0xf8, 0x0f, 0xf0, 0x1f, 0xf8, 0x07, 0xe0, 0x1f, 0xf8, 0x03, 0xc0, 0x1f,
0xfc, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x3f, 0xfe, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x00, 0x7f,
0xff, 0x00, 0x00, 0xff, 0xff, 0x80, 0x01, 0xff, 0xff, 0x80, 0x01, 0xff, 0xff, 0xc0, 0x03, 0xff,
0xff, 0xe0, 0x07, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0xf8, 0x1f, 0xff,
0xff, 0xfc, 0x3f, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff
};
void setup() {
// Initialize the display
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Check I2C address
Serial.println(F("SSD1306 allocation failed"));
for (;;); // Infinite loop if the OLED init fails
}
display.display(); // Show splash screen for a brief moment
delay(2000); // Pause for 2 seconds
display.clearDisplay(); // Clear the buffer
}
void loop() {
// Clear the display buffer
display.clearDisplay();
// Draw the navigation icon (nav3)
display.drawBitmap(48, 16, epd_bitmap_nav3, 32, 32, WHITE); // Draw at (x = 48, y = 16)
// Display the buffer on the screen
display.display();
delay(1000); // Delay to refresh the screen every second
}