#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Wire.h>
Adafruit_SSD1306 display(128, 64, &Wire, -1);
uint8_t PROGMEM mario_map[] = {
0xff, 0xff, 0xff, 0xff, /*Color of index 0*/
0x00, 0x00, 0x00, 0xff, /*Color of index 1*/
0x00, 0x3f, 0xfc, 0x00,
0x00, 0x3f, 0xfc, 0x00,
0x00, 0xff, 0xff, 0xf0,
0x00, 0xff, 0xff, 0xf0,
0x00, 0xff, 0x0c, 0x00,
0x00, 0xff, 0x0c, 0x00,
0x03, 0xcc, 0x0c, 0x00,
0x03, 0xcc, 0x0c, 0x00,
0x03, 0xcf, 0x03, 0x00,
0x03, 0xcf, 0x03, 0x00,
0x03, 0xf0, 0x0f, 0xf0,
0x03, 0xf0, 0x0f, 0xf0,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0xff, 0xfc, 0x00,
0x00, 0xff, 0xfc, 0x00,
0x03, 0xff, 0xff, 0xf0,
0x03, 0xff, 0xff, 0xf0,
0x0f, 0xff, 0xff, 0xfc,
0x0f, 0xff, 0xff, 0xfc,
0x00, 0x3c, 0xf3, 0xc0,
0x00, 0x3c, 0xf3, 0xc0,
0x00, 0x0f, 0xff, 0x00,
0x00, 0x0f, 0xff, 0x00,
0x00, 0x3f, 0xff, 0xc0,
0x00, 0x3f, 0xff, 0xc0,
0x00, 0xff, 0x3f, 0xc0,
0x00, 0xff, 0x3f, 0xc0,
0x03, 0xfc, 0x0f, 0xf0,
0x03, 0xfc, 0x0f, 0xf0,
0x0f, 0xfc, 0x0f, 0xfc,
0x0f, 0xfc, 0x0f, 0xfc,
};
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
display.display();
display.clearDisplay();
display.display();
display.drawBitmap(
(display.width() - 32 ) / 2,
(display.height() - 32) / 2,
mario_map, 32, 32, 1);
display.display();
pinMode(12, INPUT);
Serial.println(("Drawing!"));
}
void loop() {
}