#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
#define SCREEN_ADDRESS 0x3C
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
// 'starbucks (1)', 52x52px
const unsigned char epd_bitmap_starbucks__1_ [] PROGMEM = {
0x00, 0x00, 0x0f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x03,
0xff, 0xbf, 0xf8, 0x00, 0x00, 0x00, 0x07, 0xff, 0xbf, 0xfc, 0x00, 0x00, 0x00, 0x1f, 0xff, 0x1f,
0xff, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x07, 0xff, 0x80, 0x00, 0x00, 0x7f, 0xfe, 0x0f, 0xff, 0xe0,
0x00, 0x01, 0xff, 0xfe, 0x0f, 0xff, 0xf0, 0x00, 0x01, 0xff, 0x8e, 0x0e, 0x3f, 0xf8, 0x00, 0x03,
0xff, 0xc4, 0x44, 0x3f, 0xf8, 0x00, 0x07, 0xfc, 0xc0, 0xe0, 0x67, 0xfc, 0x00, 0x0f, 0xfe, 0x00,
0x00, 0x0f, 0xfe, 0x00, 0x0f, 0xfe, 0x00, 0x00, 0x0f, 0xfe, 0x00, 0x19, 0xff, 0x0f, 0xfe, 0x1f,
0xf3, 0x00, 0x38, 0xff, 0xbe, 0x0f, 0xbf, 0xe3, 0x80, 0x38, 0xff, 0xfc, 0x07, 0xff, 0xe3, 0x80,
0x38, 0x03, 0xe8, 0x02, 0xf8, 0x03, 0x80, 0x70, 0x07, 0xdf, 0x1f, 0x7c, 0x01, 0xc0, 0x70, 0x0f,
0x59, 0xbb, 0x5e, 0x01, 0xc0, 0x60, 0x1d, 0x5f, 0xbf, 0x57, 0x00, 0xc0, 0xe0, 0x3f, 0x58, 0x03,
0x5f, 0x80, 0xe0, 0xc3, 0xff, 0x58, 0x03, 0x4b, 0xf8, 0x60, 0x9f, 0xfb, 0x48, 0x42, 0x5b, 0xff,
0x20, 0xf8, 0xfd, 0x48, 0x02, 0x53, 0xe3, 0xe0, 0xe0, 0xfd, 0x6c, 0xe6, 0xd7, 0xe0, 0xe0, 0x07,
0xfd, 0x24, 0x04, 0x97, 0xfc, 0x00, 0x1f, 0xfd, 0xb7, 0x0d, 0xb7, 0xff, 0x00, 0xf1, 0xfc, 0xb7,
0xfd, 0xb7, 0xf1, 0xe0, 0xc1, 0xfd, 0xb6, 0xed, 0xb7, 0xf8, 0x60, 0x0f, 0xfd, 0x26, 0x0c, 0x97,
0xfe, 0x00, 0x3f, 0xfb, 0x6c, 0x06, 0xdb, 0xff, 0x80, 0x73, 0xf2, 0xc8, 0x02, 0x69, 0xf9, 0xc0,
0x43, 0xf4, 0x98, 0x03, 0x25, 0xf8, 0x40, 0x0f, 0xed, 0x90, 0x01, 0x36, 0xfe, 0x00, 0x3f, 0xed,
0xb0, 0x01, 0xb6, 0xff, 0x80, 0x31, 0xcd, 0x90, 0x01, 0x36, 0x71, 0x80, 0x06, 0x04, 0x98, 0x03,
0x24, 0x0c, 0x00, 0x0e, 0x06, 0xc8, 0x02, 0x6c, 0x0e, 0x00, 0x0c, 0x06, 0x4c, 0x06, 0x4c, 0x07,
0x00, 0x03, 0x1f, 0x66, 0x0c, 0xdf, 0x18, 0x00, 0x07, 0xff, 0x26, 0x0c, 0x9f, 0xfc, 0x00, 0x02,
0x7d, 0x32, 0x09, 0x97, 0xcc, 0x00, 0x00, 0xfd, 0x36, 0x0d, 0x97, 0xe0, 0x00, 0x01, 0xfb, 0x66,
0x0c, 0xdb, 0xf0, 0x00, 0x00, 0x32, 0x66, 0x0c, 0xc9, 0x80, 0x00, 0x00, 0x36, 0xcc, 0x06, 0x6d,
0x80, 0x00, 0x00, 0x04, 0xcc, 0x06, 0x64, 0x00, 0x00, 0x00, 0x04, 0x98, 0x03, 0x24, 0x00, 0x00,
0x00, 0x01, 0x98, 0x03, 0x30, 0x05, 0x90, 0x00, 0x00, 0x18, 0x03, 0x00, 0x00, 0x90, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50
};
// Array of all bitmaps for convenience. (Total bytes used to store images in PROGMEM = 384)
const int epd_bitmap_allArray_LEN = 1;
const unsigned char* epd_bitmap_allArray[1] = {
epd_bitmap_starbucks__1_
};
void setup() {
Serial.begin(9600);
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;);
}
/*
display.clearDisplay();
display.setTextColor(WHITE);
display.setCursor(10,10);
display.drawLine(0,0,127,0,WHITE);
display.drawLine(0,0,0,63,WHITE);
display.drawLine(0,63,127,63,WHITE);
display.drawLine(127,0,127,63,WHITE);
display.drawRect(5,5,117,53,WHITE);
display.display();
*/
display.clearDisplay();
display.drawBitmap(30,45,epd_bitmap_starbucks__1_,52,52,WHITE);
display.display();
}
void loop() {
}
void updateDisplay() {
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setFont(NULL);
display.setCursor(0, 10);
display.println("HELLO WORLD");
display.display();
}