#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
static const unsigned char PROGMEM eye0[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
};
static const unsigned char PROGMEM eye1[] =
{
B00000111,B11111111,B11111111,B11100000,
B00011111,B11111111,B11111111,B11111000,
B00111111,B11111111,B11111111,B11111100,
B01111111,B11111111,B11111111,B11111110,
B01111111,B11111111,B11111111,B11111110,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B01111111,B11111111,B11111111,B11111110,
B01111111,B11111111,B11111111,B11111110,
B00111111,B11111111,B11111111,B11111100,
B00011111,B11111111,B11111111,B11111000,
B00000111,B11111111,B11111111,B11100000,
};
static const unsigned char PROGMEM eye2[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B01111111,B11111110,B00000000,
B00000001,B11111111,B11111111,B10000000,
B00000011,B11111111,B11111111,B11000000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00000011,B11111111,B11111111,B11000000,
B00000001,B11111111,B11111111,B10000000,
B00000000,B01111111,B11111110,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
};
static const unsigned char PROGMEM eye3[] =
{
B00000000,B01111111,B11111110,B00000000,
B00000001,B11111111,B11111111,B10000000,
B00000011,B11111111,B11111111,B11000000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00000011,B11111111,B11111111,B11000000,
B00000001,B11111111,B11111111,B10000000,
B00000000,B01111111,B11111110,B00000000,
};
static const unsigned char PROGMEM eye4[] =
{
B00000111,B11111111,B11111111,B11100000,
B00011111,B11111111,B11111111,B11111000,
B00111111,B11111111,B11111111,B11111100,
B01111111,B11111111,B11111111,B11111110,
B01111111,B11111111,B11111111,B11111110,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111000,B00000000,B00000000,B00011111,
B11100000,B00000000,B00000000,B00000111,
B11000000,B00000000,B00000000,B00000011,
B10000000,B00000000,B00000000,B00000001,
B10000000,B00000000,B00000000,B00000001,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
};
static const unsigned char PROGMEM eye5[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B01111111,B11111110,B00000000,
B00000001,B11111111,B11111111,B10000000,
B00000011,B11111111,B11111111,B11000000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B10000000,B00000001,B11110000,
B00001110,B00000000,B00000000,B01110000,
B00001100,B00000000,B00000000,B00110000,
B00001000,B00000000,B00000000,B00010000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
};
static const unsigned char PROGMEM eye6[] =
{
B00000000,B01111111,B11111110,B00000000,
B00000001,B11111111,B11111111,B10000000,
B00000011,B11111111,B11111111,B11000000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B10000000,B00000001,B11110000,
B00001110,B00000000,B00000000,B01110000,
B00001100,B00000000,B00000000,B00110000,
B00001000,B00000000,B00000000,B00010000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
};
static const unsigned char PROGMEM eye7[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B01111111,B11111111,B11111111,B11111110,
B01111111,B11111111,B11111111,B11111110,
B00111111,B11111111,B11111111,B11111100,
B00011111,B11111111,B11111111,B11111000,
B00000111,B11111111,B11111111,B11100000,
};
static const unsigned char PROGMEM eye8[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00000011,B11111111,B11111111,B11000000,
B00000001,B11111111,B11111111,B10000000,
B00000000,B01111111,B11111110,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
};
static const unsigned char PROGMEM eye9[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00000011,B11111111,B11111111,B11000000,
B00000001,B11111111,B11111111,B10000000,
B00000000,B01111111,B11111110,B00000000,
};
static const unsigned char PROGMEM eye10i[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000010,
B00000000,B00000000,B00000000,B00011111,
B00000000,B00000000,B00000000,B11111111,
B00000000,B00000000,B00000111,B11111111,
B00000000,B00000000,B00111111,B11111111,
B00000000,B00000001,B11111111,B11111111,
B00000000,B00001111,B11111111,B11111111,
B00000000,B01111111,B11111111,B11111111,
B00000011,B11111111,B11111111,B11111111,
B00011111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B01111111,B11111111,B11111111,B11111110,
B01111111,B11111111,B11111111,B11111110,
B00111111,B11111111,B11111111,B11111100,
B00011111,B11111111,B11111111,B11111000,
B00000111,B11111111,B11111111,B11100000,
};
static const unsigned char PROGMEM eye10d[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B01000000,B00000000,B00000000,B00000000,
B11111000,B00000000,B00000000,B00000000,
B11111111,B00000000,B00000000,B00000000,
B11111111,B11100000,B00000000,B00000000,
B11111111,B11111100,B00000000,B00000000,
B11111111,B11111111,B10000000,B00000000,
B11111111,B11111111,B11110000,B00000000,
B11111111,B01111111,B11111110,B00000000,
B11111111,B11111111,B11111111,B11000000,
B11111111,B11111111,B11111111,B11111000,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B01111111,B11111111,B11111111,B11111110,
B01111111,B11111111,B11111111,B11111110,
B00111111,B11111111,B11111111,B11111100,
B00011111,B11111111,B11111111,B11111000,
B00000111,B11111111,B11111111,B11100000,
};
static const unsigned char PROGMEM eye11d[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000110,B00000000,B00000000,B00000000,
B00000111,B11000000,B00000000,B00000000,
B00001111,B11111000,B00000000,B00000000,
B00001111,B11111111,B00000000,B00000000,
B00001111,B11111111,B11100000,B00000000,
B00001111,B11111111,B11111100,B00000000,
B00001111,B11111111,B11111111,B10000000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00000011,B11111111,B11111111,B11000000,
B00000001,B11111111,B11111111,B10000000,
B00000000,B01111111,B11111110,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
};
static const unsigned char PROGMEM eye11i[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B01100000,
B00000000,B00000000,B00000011,B11100000,
B00000000,B00000000,B00011111,B11110000,
B00000000,B00000000,B11111111,B11110000,
B00000000,B00000111,B11111111,B11110000,
B00000000,B00111111,B11111111,B11110000,
B00000001,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00000011,B11111111,B11111111,B11000000,
B00000001,B11111111,B11111111,B10000000,
B00000000,B01111111,B11111110,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
};
static const unsigned char PROGMEM eye12d[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000110,B00000000,B00000000,B00000000,
B00000111,B11000000,B00000000,B00000000,
B00001111,B11111000,B00000000,B00000000,
B00001111,B11111111,B00000000,B00000000,
B00001111,B11111111,B11100000,B00000000,
B00001111,B11111111,B11111100,B00000000,
B00001111,B11111111,B11111111,B10000000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00000011,B11111111,B11111111,B11000000,
B00000001,B11111111,B11111111,B10000000,
B00000000,B01111111,B11111110,B00000000,
};
static const unsigned char PROGMEM eye12i[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B01100000,
B00000000,B00000000,B00000011,B11100000,
B00000000,B00000000,B00011111,B11110000,
B00000000,B00000000,B11111111,B11110000,
B00000000,B00000111,B11111111,B11110000,
B00000000,B00111111,B11111111,B11110000,
B00000001,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00000011,B11111111,B11111111,B11000000,
B00000001,B11111111,B11111111,B10000000,
B00000000,B01111111,B11111110,B00000000,
};
static const unsigned char PROGMEM eye13d[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000010,
B00000000,B00000000,B00000000,B00011111,
B00000000,B00000000,B00000000,B11111111,
B00000000,B00000000,B00000111,B11111111,
B00000000,B00000000,B00111111,B11111111,
B00000000,B00000001,B11111111,B11111111,
B00000000,B00001111,B11111111,B11111111,
B00000000,B01111111,B11111111,B11111111,
B00000011,B11111111,B11111111,B11111111,
B00011111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B01111111,B11111111,B11111111,B11111110,
B01111111,B11111111,B11111111,B11111110,
B00111111,B11111111,B11111111,B11111100,
B00011111,B11111111,B11111111,B11111000,
B00000111,B11111111,B11111111,B11100000,
};
static const unsigned char PROGMEM eye13i[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B01000000,B00000000,B00000000,B00000000,
B11111000,B00000000,B00000000,B00000000,
B11111111,B00000000,B00000000,B00000000,
B11111111,B11100000,B00000000,B00000000,
B11111111,B11111100,B00000000,B00000000,
B11111111,B11111111,B10000000,B00000000,
B11111111,B11111111,B11110000,B00000000,
B11111111,B01111111,B11111110,B00000000,
B11111111,B11111111,B11111111,B11000000,
B11111111,B11111111,B11111111,B11111000,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,
B01111111,B11111111,B11111111,B11111110,
B01111111,B11111111,B11111111,B11111110,
B00111111,B11111111,B11111111,B11111100,
B00011111,B11111111,B11111111,B11111000,
B00000111,B11111111,B11111111,B11100000,
};
static const unsigned char PROGMEM eye14i[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000110,B00000000,B00000000,B00000000,
B00000111,B11000000,B00000000,B00000000,
B00001111,B11111000,B00000000,B00000000,
B00001111,B11111111,B00000000,B00000000,
B00001111,B11111111,B11100000,B00000000,
B00001111,B11111111,B11111100,B00000000,
B00001111,B11111111,B11111111,B10000000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00000011,B11111111,B11111111,B11000000,
B00000001,B11111111,B11111111,B10000000,
B00000000,B01111111,B11111110,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
};
static const unsigned char PROGMEM eye14d[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B01100000,
B00000000,B00000000,B00000011,B11100000,
B00000000,B00000000,B00011111,B11110000,
B00000000,B00000000,B11111111,B11110000,
B00000000,B00000111,B11111111,B11110000,
B00000000,B00111111,B11111111,B11110000,
B00000001,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00000011,B11111111,B11111111,B11000000,
B00000001,B11111111,B11111111,B10000000,
B00000000,B01111111,B11111110,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
};
static const unsigned char PROGMEM eye15i[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000110,B00000000,B00000000,B00000000,
B00000111,B11000000,B00000000,B00000000,
B00001111,B11111000,B00000000,B00000000,
B00001111,B11111111,B00000000,B00000000,
B00001111,B11111111,B11100000,B00000000,
B00001111,B11111111,B11111100,B00000000,
B00001111,B11111111,B11111111,B10000000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00000011,B11111111,B11111111,B11000000,
B00000001,B11111111,B11111111,B10000000,
B00000000,B01111111,B11111110,B00000000,
};
static const unsigned char PROGMEM eye15d[] =
{
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B01100000,
B00000000,B00000000,B00000011,B11100000,
B00000000,B00000000,B00011111,B11110000,
B00000000,B00000000,B11111111,B11110000,
B00000000,B00000111,B11111111,B11110000,
B00000000,B00111111,B11111111,B11110000,
B00000001,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00001111,B11111111,B11111111,B11110000,
B00000111,B11111111,B11111111,B11100000,
B00000111,B11111111,B11111111,B11100000,
B00000011,B11111111,B11111111,B11000000,
B00000001,B11111111,B11111111,B10000000,
B00000000,B01111111,B11111110,B00000000,
};
// [mood][pos][l/r]
const unsigned char *peyes[][3][2]={
{ { eye4, eye4},{ eye5, eye5},{ eye6, eye6} },
{ { eye1, eye1},{ eye2, eye2},{ eye3, eye3} },
{ { eye0, eye0},{ eye0, eye0},{ eye0, eye0} },
{ { eye10d, eye10i},{ eye11d, eye11i},{ eye12d, eye12i} },
{ { eye7, eye7},{ eye8, eye8},{ eye9, eye9} },
{ { eye13d, eye13i},{ eye14d, eye14i},{ eye15d, eye15i} },
};
void setup() {
// put your setup code here, to run once:
pinMode(12,INPUT_PULLUP);
pinMode(13,INPUT_PULLUP);
pinMode(14,INPUT_PULLUP);
pinMode(4,INPUT_PULLUP);
Serial.begin(115200);
Serial.println("Booting");
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3c)) { // Address 0x3D for 128x64
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
// Show initial display buffer contents on the screen --
// the library initializes this with an Adafruit splash screen.
display.display();
// Clear the buffer
display.clearDisplay();
display.display();
}
unsigned char readkey(void){
unsigned char ret=0;
if (digitalRead(12)==0 ) ret=1; //izquierda
if (digitalRead(13)==0) ret+=2; //arriba
if (digitalRead(14)==0) ret+=4; //abajo
if (digitalRead(4)==0) ret+=8; //fuego
return (ret);
}
int xp=16;
int mood=1;
void loop() {
int n;
static int xd=0;
static int espera=0;
static int step=0;
int x1,x2;
if (espera>0) {
espera--;
delay(1);
} else {
x1= xd+ (xp>16? (16+2*(xp-16)):xp);
x2=64+xd+ (xp<16? (-16+(xp*2)) :xp);
switch (step){
case 0:
display.clearDisplay(); // Clear the display buffer
if (xp<6) {
display.drawBitmap(x1, 8, peyes[mood][2][0], 32, 32, WHITE);
display.drawBitmap(x2, 8, peyes[mood][1][1], 32, 32, WHITE);
} else if (xp<26) {
display.drawBitmap(x1, 8, peyes[mood][0][0], 32, 32, WHITE);
display.drawBitmap(x2, 8, peyes[mood][0][1], 32, 32, WHITE);
} else {
display.drawBitmap(x1, 8, peyes[mood][1][0], 32, 32, WHITE);
display.drawBitmap(x2, 8, peyes[mood][2][1], 32, 32, WHITE);
}
display.display();
espera=random(250, 1000);
n=random(0,7);
if (n==6) {
step=1;
} else {
step=2;
}
break;
case 1:
display.clearDisplay(); // Clear the display buffer
display.drawBitmap(x1, 8, eye0, 32, 32, WHITE);
display.drawBitmap(x2, 8, eye0, 32, 32, WHITE);
display.display();
espera=100;
step=0;
break;
case 2:
n=random(0,10);
if (n<5) xd--;
if (n>5) xd++;
if (xd<-4) xd=-3;
if (xd>4) xd=3;
espera=0;
step=0;
break;
}
}
//n=0;
n=readkey();
if (n==2) xp=(xp<=0?0:xp-1);
if (n==4) xp=(xp>=32?32:xp+1);
if (n==1) {
mood=(mood>=5?0:mood+1);
do {} while (readkey()!=0);
}
if (n!=0) { espera=0; step=0; }
}
esp:VIN
esp:GND.2
esp:D13
esp:D12
esp:D14
esp:D27
esp:D26
esp:D25
esp:D33
esp:D32
esp:D35
esp:D34
esp:VN
esp:VP
esp:EN
esp:3V3
esp:GND.1
esp:D15
esp:D2
esp:D4
esp:RX2
esp:TX2
esp:D5
esp:D18
esp:D19
esp:D21
esp:RX0
esp:TX0
esp:D22
esp:D23
oled1:GND
oled1:VCC
oled1:SCL
oled1:SDA
btn1:1.l
btn1:2.l
btn1:1.r
btn1:2.r
btn2:1.l
btn2:2.l
btn2:1.r
btn2:2.r
btn3:1.l
btn3:2.l
btn3:1.r
btn3:2.r
btn4:1.l
btn4:2.l
btn4:1.r
btn4:2.r