#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// OLED FeatherWing buttons map to different pins depending on board.
// The I2C (Wire) bus may also be different.
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(128, 64, &Wire, OLED_RESET);
static const unsigned char PROGMEM logo_bmp[] =
{
// 'person', 65x64px
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0x1f,
0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xf0, 0x00, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff,
0xc0, 0x00, 0x3f, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xff, 0xff, 0x80, 0xff,
0xff, 0xfe, 0x00, 0x00, 0x07, 0xff, 0xff, 0x80, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xff, 0xff,
0x80, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x01, 0xff, 0xff, 0x80, 0xff, 0xff, 0xf0, 0x00, 0x60, 0x00,
0xff, 0xff, 0x80, 0xff, 0xff, 0xe0, 0x07, 0xfc, 0x00, 0xff, 0xff, 0x80, 0xff, 0xff, 0xe0, 0x0f,
0xff, 0x00, 0x7f, 0xff, 0x80, 0xff, 0xff, 0xc0, 0x1f, 0xff, 0x80, 0x7f, 0xff, 0x80, 0xff, 0xff,
0xc0, 0x3f, 0xff, 0xc0, 0x3f, 0xff, 0x80, 0xff, 0xff, 0x80, 0x7f, 0xff, 0xc0, 0x3f, 0xff, 0x80,
0xff, 0xff, 0x80, 0x7f, 0xff, 0xe0, 0x3f, 0xff, 0x80, 0xff, 0xff, 0x80, 0x7f, 0xff, 0xe0, 0x3f,
0xff, 0x80, 0xff, 0xff, 0x80, 0xff, 0xff, 0xe0, 0x1f, 0xff, 0x80, 0xff, 0xff, 0x80, 0xff, 0xff,
0xe0, 0x1f, 0xff, 0x80, 0xff, 0xff, 0x80, 0xff, 0xff, 0xe0, 0x1f, 0xff, 0x80, 0xff, 0xff, 0x80,
0xff, 0xff, 0xe0, 0x1f, 0xff, 0x80, 0xff, 0xff, 0x80, 0x7f, 0xff, 0xe0, 0x1f, 0xff, 0x80, 0xff,
0xff, 0x80, 0x7f, 0xff, 0xc0, 0x3f, 0xff, 0x80, 0xff, 0xff, 0x80, 0x3f, 0xff, 0xc0, 0x3f, 0xff,
0x80, 0xff, 0xff, 0xc0, 0x3f, 0xff, 0x80, 0x3f, 0xff, 0x80, 0xff, 0xff, 0xc0, 0x1f, 0xff, 0x00,
0x7f, 0xff, 0x80, 0xff, 0xff, 0xe0, 0x0f, 0xfe, 0x00, 0x7f, 0xff, 0x80, 0xff, 0xff, 0xe0, 0x03,
0xf8, 0x00, 0xff, 0xff, 0x80, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0xff, 0xff, 0x80, 0xff, 0xff,
0xf0, 0x00, 0x00, 0x01, 0xff, 0xff, 0x80, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x01, 0xff, 0xff, 0x80,
0xff, 0xff, 0xf8, 0x00, 0x00, 0x03, 0xff, 0xff, 0x80, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xff,
0xff, 0x80, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x07, 0xff, 0xff, 0x80, 0xff, 0xff, 0xfe, 0x00, 0x00,
0x0f, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff,
0x00, 0x00, 0x1f, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xff, 0x80, 0xff,
0x00, 0x0f, 0xc0, 0x00, 0x3e, 0x00, 0x1f, 0x80, 0xfe, 0x00, 0x07, 0xc0, 0x00, 0x7e, 0x00, 0x07,
0x80, 0xfc, 0x00, 0x03, 0xe0, 0x00, 0xfc, 0x00, 0x07, 0x80, 0xfc, 0x00, 0x03, 0xf0, 0x01, 0xf8,
0x00, 0x03, 0x80, 0xfc, 0x00, 0x01, 0xf8, 0x01, 0xf0, 0x00, 0x03, 0x80, 0xf8, 0x00, 0x00, 0xfc,
0x03, 0xf0, 0x00, 0x03, 0x80, 0xf8, 0x00, 0x00, 0x7e, 0x07, 0xe0, 0x00, 0x03, 0x80, 0xf8, 0x00,
0x00, 0x7f, 0x0f, 0xc0, 0x00, 0x01, 0x80, 0xf8, 0x00, 0x00, 0x3f, 0x9f, 0x80, 0x00, 0x01, 0x80,
0xf0, 0x00, 0x00, 0x1f, 0xff, 0x00, 0x00, 0x01, 0x80, 0xf0, 0x00, 0x00, 0x0f, 0xfe, 0x00, 0x00,
0x01, 0x80, 0xf0, 0x00, 0x00, 0x07, 0xfc, 0x00, 0x00, 0x00, 0x80, 0xf0, 0x00, 0x00, 0x03, 0xf8,
0x00, 0x00, 0x00, 0x80, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x80, 0xe0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80
};
void setup() {
display.begin(SSD1306_SWITCHCAPVCC, 0x3c); // Address 0x3C for 128x32
display.display();
delay(1000);
/*delay(1000);
// Clear the buffer.
display.clearDisplay();
// text display tests
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0,0);
display.print("Connecting to SSID\n'adafruit':");
display.print("connected!");
display.println("IP: 10.0.1.23");
display.println("Sending val #0");
display.setCursor(0,0);
display.display(); // actually display all of the above*/
}
void loop(){
display.clearDisplay();
display.drawBitmap(0,0,logo_bmp,65,64,SSD1306_WHITE);
display.display();
}