/* A-Maze
by Alojz Jakob <http://jakobdesign.com>
********** TAMAGUINO ***********
* Maze game for Arduino *
********************************
*/
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1 // not used
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
// 'title', 128x64px
const unsigned char title1 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfc, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x3e, 0x07, 0xe0, 0x07, 0xff, 0xc0,
0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x03, 0x10, 0x00, 0xe0, 0xa0, 0x3c, 0x0c, 0x00, 0x70,
0x00, 0x00, 0x7b, 0xc0, 0x00, 0x00, 0x20, 0x02, 0x18, 0x00, 0x9d, 0x44, 0x06, 0x0a, 0x44, 0x10,
0x00, 0x01, 0x80, 0x60, 0x00, 0x00, 0xf8, 0x05, 0x88, 0x00, 0xba, 0x90, 0x01, 0x1d, 0x10, 0x08,
0x00, 0x02, 0xf4, 0x10, 0x00, 0x01, 0xac, 0x0b, 0x08, 0x00, 0x95, 0x42, 0x03, 0x2a, 0x00, 0x08,
0x00, 0x05, 0xaa, 0x88, 0x00, 0x01, 0x66, 0x16, 0x88, 0x00, 0xc0, 0x00, 0x02, 0x79, 0x40, 0x08,
0x00, 0x0b, 0xd4, 0x04, 0x00, 0x02, 0xd3, 0x2d, 0x08, 0x0f, 0xc0, 0x00, 0x04, 0x54, 0x00, 0x10,
0x00, 0x16, 0xaa, 0xa2, 0x00, 0x02, 0xa9, 0xda, 0x88, 0x78, 0x7f, 0xfc, 0x08, 0xa8, 0x00, 0x20,
0x00, 0x2f, 0x40, 0x09, 0x00, 0x02, 0x54, 0x15, 0x48, 0x80, 0x10, 0x04, 0x08, 0xd5, 0x01, 0xc0,
0x00, 0x2a, 0xfc, 0x20, 0x80, 0x06, 0xa8, 0x0a, 0x09, 0x28, 0x08, 0x08, 0x11, 0x28, 0x7f, 0x00,
0x00, 0x5d, 0x87, 0x00, 0xc0, 0x04, 0x52, 0x00, 0x8a, 0xd2, 0x04, 0x10, 0x21, 0x44, 0x40, 0x00,
0x00, 0x49, 0x01, 0x80, 0x40, 0x05, 0x28, 0x04, 0x0d, 0x80, 0x06, 0x20, 0x62, 0xa0, 0x40, 0x00,
0x00, 0xa1, 0x00, 0x80, 0x40, 0x0c, 0x00, 0x00, 0x0b, 0x3c, 0x02, 0x50, 0x42, 0x00, 0x3f, 0x80,
0x00, 0x89, 0x00, 0xc0, 0x40, 0x08, 0x0a, 0x01, 0x12, 0xe6, 0x01, 0xa0, 0x84, 0x08, 0x01, 0xc0,
0x00, 0x81, 0x00, 0x40, 0xff, 0xfc, 0x00, 0x00, 0x25, 0x83, 0x81, 0x70, 0x84, 0x20, 0x50, 0xc0,
0x00, 0xa1, 0x00, 0x41, 0x80, 0x06, 0x02, 0x1c, 0x69, 0x00, 0x82, 0xa1, 0x88, 0x00, 0x00, 0xc0,
0x00, 0x84, 0x80, 0xd1, 0x75, 0x42, 0x00, 0x36, 0x45, 0x01, 0x85, 0x41, 0x08, 0x10, 0x00, 0xc0,
0x01, 0x00, 0x80, 0x81, 0x6a, 0x12, 0x00, 0x6a, 0x91, 0x01, 0x0a, 0x81, 0x10, 0x00, 0x01, 0x80,
0x01, 0x00, 0x41, 0xa1, 0x55, 0x46, 0x18, 0x47, 0x05, 0x03, 0x11, 0x49, 0x10, 0x07, 0xff, 0x00,
0x01, 0x00, 0x3e, 0x00, 0x80, 0x0c, 0x1e, 0x85, 0x11, 0x82, 0x34, 0x01, 0x10, 0x04, 0x00, 0x00,
0x01, 0x00, 0x00, 0xa0, 0x7f, 0xf8, 0x13, 0x06, 0x00, 0xc2, 0x20, 0x81, 0x90, 0x04, 0x00, 0x00,
0x01, 0x00, 0x02, 0x00, 0x20, 0x20, 0x20, 0x06, 0x00, 0x34, 0xa2, 0x00, 0x70, 0x04, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x04, 0x00, 0x18, 0x20, 0x00, 0x1f, 0x87, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x20, 0x20, 0x40, 0x04, 0x03, 0x82, 0x30, 0x00, 0x00, 0xc1, 0xf0, 0x00,
0x01, 0x00, 0x0c, 0x00, 0x20, 0x20, 0x40, 0x08, 0x04, 0xc0, 0x18, 0x00, 0x00, 0x44, 0x18, 0x00,
0x01, 0x00, 0x3f, 0x00, 0x20, 0x60, 0x80, 0x08, 0x08, 0x30, 0x0c, 0x00, 0x00, 0x40, 0x08, 0x00,
0x01, 0x00, 0x21, 0x80, 0x20, 0x41, 0x80, 0x10, 0x10, 0x10, 0x06, 0x00, 0x00, 0x40, 0x08, 0x00,
0x01, 0x80, 0x60, 0x40, 0x20, 0x41, 0x00, 0x20, 0x30, 0x08, 0x01, 0x00, 0x00, 0x40, 0x30, 0x00,
0x00, 0xc0, 0x40, 0x60, 0x40, 0x41, 0x00, 0x20, 0x50, 0x04, 0x00, 0x80, 0x00, 0x40, 0x60, 0x00,
0x00, 0x60, 0x80, 0x20, 0x80, 0x42, 0x00, 0x40, 0x90, 0x03, 0x80, 0xf8, 0x00, 0x7f, 0xc0, 0x00,
0x00, 0x3b, 0x80, 0x31, 0x80, 0x62, 0x00, 0x41, 0x20, 0x00, 0xc3, 0x0f, 0x80, 0x80, 0x00, 0x00,
0x00, 0x0e, 0x00, 0x1e, 0x00, 0x1c, 0x00, 0x42, 0x20, 0x00, 0x7e, 0x00, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf3, 0x21, 0xcc, 0x38, 0x17, 0xc0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcb, 0x23, 0x2c, 0x64, 0x10, 0xc0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf3, 0xa3, 0x2c, 0x64, 0x11, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc9, 0xc3, 0xec, 0x65, 0x93, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x83, 0x2c, 0x65, 0x96, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x83, 0x2f, 0x38, 0xe7, 0xc0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// 'title2', 128x64px
const unsigned char title2 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xa8, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x14, 0x05, 0x40, 0x05, 0x55, 0x40,
0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0xa0, 0xa0, 0x28, 0x08, 0x00, 0x20,
0x00, 0x00, 0x51, 0x40, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x15, 0x44, 0x04, 0x00, 0x44, 0x10,
0x00, 0x00, 0x80, 0x20, 0x00, 0x00, 0xa8, 0x00, 0x88, 0x00, 0xaa, 0x80, 0x00, 0x08, 0x00, 0x08,
0x00, 0x00, 0x54, 0x10, 0x00, 0x01, 0x04, 0x01, 0x00, 0x00, 0x15, 0x40, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0xaa, 0x88, 0x00, 0x00, 0x22, 0x02, 0x88, 0x00, 0x80, 0x00, 0x02, 0x28, 0x00, 0x08,
0x00, 0x01, 0x54, 0x04, 0x00, 0x00, 0x51, 0x05, 0x00, 0x05, 0x40, 0x00, 0x04, 0x54, 0x00, 0x10,
0x00, 0x02, 0xaa, 0xa2, 0x00, 0x02, 0xa8, 0x8a, 0x88, 0x28, 0x2a, 0xa8, 0x08, 0xa8, 0x00, 0x20,
0x00, 0x05, 0x40, 0x01, 0x00, 0x00, 0x54, 0x15, 0x40, 0x00, 0x10, 0x04, 0x00, 0x55, 0x01, 0x40,
0x00, 0x2a, 0xa8, 0x20, 0x80, 0x02, 0xa8, 0x0a, 0x08, 0x28, 0x08, 0x08, 0x00, 0x28, 0x2a, 0x00,
0x00, 0x55, 0x05, 0x00, 0x40, 0x04, 0x50, 0x00, 0x00, 0x50, 0x04, 0x10, 0x01, 0x44, 0x40, 0x00,
0x00, 0x08, 0x00, 0x80, 0x00, 0x00, 0x28, 0x00, 0x08, 0x80, 0x02, 0x20, 0x22, 0xa0, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x01, 0x14, 0x00, 0x50, 0x40, 0x00, 0x15, 0x00,
0x00, 0x88, 0x00, 0x80, 0x00, 0x08, 0x0a, 0x00, 0x02, 0xa2, 0x00, 0xa0, 0x80, 0x08, 0x00, 0x80,
0x00, 0x01, 0x00, 0x40, 0x55, 0x54, 0x00, 0x00, 0x05, 0x01, 0x01, 0x50, 0x04, 0x00, 0x50, 0x40,
0x00, 0xa0, 0x00, 0x00, 0x80, 0x02, 0x02, 0x08, 0x28, 0x00, 0x82, 0xa0, 0x88, 0x00, 0x00, 0x80,
0x00, 0x04, 0x00, 0x51, 0x55, 0x40, 0x00, 0x14, 0x45, 0x01, 0x05, 0x41, 0x00, 0x10, 0x00, 0x40,
0x00, 0x00, 0x80, 0x80, 0x2a, 0x02, 0x00, 0x2a, 0x80, 0x00, 0x0a, 0x80, 0x00, 0x00, 0x00, 0x80,
0x01, 0x00, 0x41, 0x01, 0x55, 0x44, 0x10, 0x45, 0x05, 0x01, 0x11, 0x41, 0x10, 0x05, 0x55, 0x00,
0x00, 0x00, 0x2a, 0x00, 0x80, 0x08, 0x0a, 0x80, 0x00, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x55, 0x50, 0x11, 0x04, 0x00, 0x40, 0x00, 0x01, 0x10, 0x04, 0x00, 0x00,
0x00, 0x00, 0x02, 0x00, 0x20, 0x20, 0x20, 0x02, 0x00, 0x20, 0xa2, 0x00, 0x20, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x15, 0x05, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x02, 0x82, 0x20, 0x00, 0x00, 0x80, 0xa0, 0x00,
0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x04, 0x40, 0x10, 0x00, 0x00, 0x44, 0x10, 0x00,
0x00, 0x00, 0x2a, 0x00, 0x20, 0x20, 0x80, 0x08, 0x08, 0x20, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00,
0x01, 0x00, 0x01, 0x00, 0x00, 0x41, 0x00, 0x10, 0x10, 0x10, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00,
0x00, 0x80, 0x20, 0x00, 0x20, 0x00, 0x00, 0x20, 0x20, 0x08, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00,
0x00, 0x40, 0x40, 0x40, 0x40, 0x41, 0x00, 0x00, 0x50, 0x04, 0x00, 0x00, 0x00, 0x40, 0x40, 0x00,
0x00, 0x20, 0x80, 0x20, 0x80, 0x02, 0x00, 0x00, 0x80, 0x02, 0x80, 0xa8, 0x00, 0x2a, 0x80, 0x00,
0x00, 0x11, 0x00, 0x11, 0x00, 0x40, 0x00, 0x41, 0x00, 0x00, 0x41, 0x05, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0a, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x02, 0x20, 0x00, 0x2a, 0x00, 0xaa, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x01, 0x44, 0x10, 0x15, 0x40, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x22, 0x28, 0x20, 0x00, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x01, 0x04, 0x44, 0x11, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x82, 0xa8, 0x20, 0x82, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x04, 0x45, 0x14, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x82, 0x2a, 0x28, 0xa2, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// 'title3', 128x64px
const unsigned char title3 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x01, 0x11, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x80, 0xa0, 0x08, 0x08, 0x00, 0x00,
0x00, 0x00, 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x15, 0x44, 0x00, 0x00, 0x44, 0x00,
0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x88, 0x00, 0x80, 0x00, 0x2a, 0x80, 0x00, 0x08, 0x00, 0x08,
0x00, 0x00, 0x54, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x15, 0x40, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0x20, 0x02, 0x88, 0x00, 0x80, 0x00, 0x00, 0x28, 0x00, 0x08,
0x00, 0x01, 0x54, 0x04, 0x00, 0x00, 0x51, 0x05, 0x00, 0x05, 0x40, 0x00, 0x00, 0x54, 0x00, 0x00,
0x00, 0x02, 0xaa, 0xa0, 0x00, 0x02, 0xa8, 0x0a, 0x80, 0x28, 0x22, 0x20, 0x08, 0xa8, 0x00, 0x00,
0x00, 0x05, 0x40, 0x01, 0x00, 0x00, 0x54, 0x15, 0x40, 0x00, 0x10, 0x04, 0x00, 0x55, 0x01, 0x00,
0x00, 0x0a, 0xa8, 0x20, 0x00, 0x02, 0xa8, 0x0a, 0x08, 0x28, 0x08, 0x00, 0x00, 0x28, 0x20, 0x00,
0x00, 0x15, 0x05, 0x00, 0x40, 0x00, 0x50, 0x00, 0x00, 0x50, 0x04, 0x00, 0x01, 0x44, 0x40, 0x00,
0x00, 0x08, 0x00, 0x80, 0x00, 0x00, 0x28, 0x00, 0x00, 0x80, 0x02, 0x20, 0x22, 0xa0, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x14, 0x00, 0x10, 0x00, 0x00, 0x11, 0x00,
0x00, 0x08, 0x00, 0x80, 0x00, 0x00, 0x0a, 0x00, 0x02, 0xa0, 0x00, 0x20, 0x00, 0x08, 0x00, 0x00,
0x00, 0x01, 0x00, 0x40, 0x44, 0x00, 0x00, 0x00, 0x05, 0x01, 0x00, 0x50, 0x04, 0x00, 0x00, 0x00,
0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x28, 0x00, 0x02, 0xa0, 0x88, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0x51, 0x55, 0x40, 0x00, 0x10, 0x04, 0x00, 0x01, 0x40, 0x00, 0x10, 0x00, 0x40,
0x00, 0x00, 0x80, 0x80, 0x2a, 0x02, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x41, 0x00, 0x55, 0x40, 0x00, 0x41, 0x05, 0x01, 0x01, 0x40, 0x10, 0x04, 0x11, 0x00,
0x00, 0x00, 0x2a, 0x00, 0x80, 0x08, 0x00, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x11, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x04, 0x00, 0x00,
0x00, 0x00, 0x02, 0x00, 0x00, 0x20, 0x20, 0x02, 0x00, 0x00, 0x82, 0x00, 0x20, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x82, 0x20, 0x00, 0x00, 0x80, 0x20, 0x00,
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x20, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x20, 0x80, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0a, 0x00, 0x08, 0x00, 0x08, 0x00, 0x02, 0x20, 0x00, 0x22, 0x00, 0x82, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x01, 0x44, 0x10, 0x15, 0x40, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x22, 0x28, 0x20, 0x00, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x01, 0x04, 0x44, 0x11, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x82, 0xa8, 0x20, 0x82, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x04, 0x45, 0x14, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x82, 0x2a, 0x28, 0xa2, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// 'title4', 128x64px
const unsigned char title4 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x01, 0x11, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x80, 0x00, 0x08, 0x08, 0x00, 0x00,
0x00, 0x00, 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00,
0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x08, 0x00, 0x08,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x80, 0x00, 0x00, 0x20, 0x00, 0x08,
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x00, 0x00, 0x05, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x28, 0x22, 0x20, 0x08, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x01, 0x00,
0x00, 0x00, 0x28, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x20, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00,
0x00, 0x10, 0x05, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x04, 0x00, 0x01, 0x04, 0x40, 0x00,
0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x20, 0x22, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x11, 0x00,
0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x00, 0x01, 0x00, 0x40, 0x44, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x02, 0x00, 0x88, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x40,
0x00, 0x00, 0x80, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x05, 0x01, 0x01, 0x00, 0x10, 0x04, 0x11, 0x00,
0x00, 0x00, 0x22, 0x00, 0x80, 0x08, 0x00, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x11, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x04, 0x00, 0x00,
0x00, 0x00, 0x02, 0x00, 0x00, 0x20, 0x20, 0x02, 0x00, 0x00, 0x82, 0x00, 0x20, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x82, 0x20, 0x00, 0x00, 0x80, 0x20, 0x00,
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x20, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x20, 0x80, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0a, 0x00, 0x08, 0x00, 0x08, 0x00, 0x02, 0x20, 0x00, 0x22, 0x00, 0x82, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x10, 0x11, 0x40, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x22, 0x20, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x82, 0x22, 0x20, 0x22, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const unsigned char brick [] PROGMEM = {
// 'brick, 4x4px
0xf9, 0xdf
};
const unsigned char checker [] PROGMEM = {
// 'checker, 4x4px
0x5a, 0x5a
};
const int button1Pin = 9; //LEFT
const int button2Pin = 8; //RIGHT
const int button3Pin = 7; //UP
const int button4Pin = 6; //DOWN
const int button5Pin = 5; //A
const int button6Pin = 4; //B
const int button7Pin = 2; //MENU
const int sound = 3;
int button1State = 0;
int button2State = 0;
int button3State = 0;
int button4State = 0;
int button5State = 0;
int button6State = 0;
int button7State = 0;
#define ACTIVATED LOW
#define DELAYMULTIPLIER 0
#define MAZEHEIGHT 32
#define MAZEWIDTH 15
uint16_t Maze[] = {
0b1101111111111111,
0b1100000000000001,
0b1101010101010101,
0b1100000000000001,
0b1101010101010101,
0b1100000000000001,
0b1101010101010101,
0b1100000000000001,
0b1101010101010101,
0b1100000000000001,
0b1101010101010101,
0b1100000000000001,
0b1101010101010101,
0b1100000000000001,
0b1101010101010101,
0b1100000000000001,
0b1101010101010101,
0b1100000000000001,
0b1101010101010101,
0b1100000000000001,
0b1101010101010101,
0b1100000000000001,
0b1101010101010101,
0b1100000000000001,
0b1101010101010101,
0b1100000000000001,
0b1101010101010101,
0b1100000000000001,
0b1101010101010101,
0b1100000000000001,
0b1101010101010101,
0b1111111111111101,
0b0000000000000000
};
uint8_t geni, genj, genk, genval, genmod;
int8_t genx, geny;
int posx=0, posy=2; // Where you are in the Maze
int illuminatedRow=0;
int blinkPlayer=1;
int wallPhase=1;
int level=1;
void setup() {
Serial.begin(9600);
pinMode(button1Pin, INPUT);
pinMode(button2Pin, INPUT);
pinMode(button3Pin, INPUT);
pinMode(button4Pin, INPUT);
pinMode(button5Pin, INPUT);
pinMode(button6Pin, INPUT);
pinMode(button7Pin, INPUT);
digitalWrite(button1Pin, HIGH);
digitalWrite(button2Pin, HIGH);
digitalWrite(button3Pin, HIGH);
digitalWrite(button4Pin, HIGH);
digitalWrite(button5Pin, HIGH);
digitalWrite(button6Pin, HIGH);
digitalWrite(button7Pin, HIGH);
// or just
// pinMode(button1Pin, INPUT_PULLUP)
// etc
pinMode(sound, OUTPUT);
pinMode(13,OUTPUT);
randomSeed(analogRead(A0));
delay(random(2,2000));
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println("SSD1306 init failed");
while (1);
}
display.clearDisplay();
// splash
display.setTextColor(WHITE);
//display.println(F("jakobdesign presents"));
//display.print(F(" generating maze..."));
display.drawBitmap(0, 0, title4 , 128, 64, WHITE);
display.display();
tone(sound,1500,5);
delay(100);
display.clearDisplay();
display.drawBitmap(0, 0, title3 , 128, 64, WHITE);
display.display();
tone(sound,1500,5);
delay(100);
display.clearDisplay();
display.drawBitmap(0, 0, title2 , 128, 64, WHITE);
display.display();
tone(sound,1500,5);
delay(100);
display.clearDisplay();
display.drawBitmap(0, 0, title1 , 128, 64, WHITE);
display.display();
tone(sound,1500,5);
delay(3000);
display.clearDisplay();
display.drawBitmap(0, 0, title2 , 128, 64, WHITE);
display.display();
tone(sound,1500,5);
delay(100);
display.clearDisplay();
display.drawBitmap(0, 0, title3 , 128, 64, WHITE);
display.display();
tone(sound,1500,5);
delay(100);
display.clearDisplay();
display.drawBitmap(0, 0, title4 , 128, 64, WHITE);
display.display();
tone(sound,1500,5);
delay(100);
display.clearDisplay();
//display.drawBitmap(15, 24, splash1 , 48, 26, WHITE);
//display.drawBitmap(48, 24, splash2 , 80, 40, WHITE);
//splash tone
//delay(200);
//tone(sound,1000,200);
//delay(400);
//tone(sound,700,200);
//delay(200);
//tone(sound,1100,200);
// end splash
generateMaze();
//delay(2000);
//for(int i=0;i<MAZEHEIGHT;i++){
// Serial.println(Maze[i],BIN);
//}
//drawMazeSerial();
display.clearDisplay();
}
void loop() {
button1State = digitalRead(button1Pin);
button2State = digitalRead(button2Pin);
button3State = digitalRead(button3Pin);
button4State = digitalRead(button4Pin);
button5State = digitalRead(button5Pin);
button6State = digitalRead(button6Pin);
button7State = digitalRead(button7Pin);
display.clearDisplay();
/* ------- BUTTON PRESS ACTIONS ------- */
bool wall;
/* ------- BUTTON 1 - LEFT ------- */
if(button1State==ACTIVATED){
//generateMaze();
if(posx-1>=0){
wall=readPixel(posx-1,posy);
if(!wall){
--posx;
tone(sound,1600,5);
}else{
tone(sound,100,50);
}
}else{
tone(sound,100,50);
}
delay(20);
}
/* ------- BUTTON 2 - RIGHT ------- */
if(button2State==ACTIVATED){
if(posx+1<=MAZEHEIGHT){
wall=readPixel(posx+1,posy);
if(!wall){
++posx;
tone(sound,1600,5);
}else{
tone(sound,100,50);
}
}else{
tone(sound,100,50);
}
delay(20);
}
/* ------- BUTTON 3 - UP ------- */
if(button3State==ACTIVATED){
if(posy-1>=2){
wall=readPixel(posx,posy-1);
if(!wall){
--posy;
tone(sound,1600,5);
}else{
tone(sound,100,50);
}
}else{
tone(sound,100,50);
}
delay(20);
}
/* ------- BUTTON 4 - DOWN ------- */
if(button4State==ACTIVATED){
if(posy+1<=MAZEWIDTH){
wall=readPixel(posx,posy+1);
if(!wall){
++posy;
tone(sound,1600,5);
}else{
tone(sound,100,50);
}
}else{
tone(sound,100,50);
}
delay(20);
}
if(button5State==ACTIVATED){
display.fillCircle(20,30,5,WHITE);
}
if(button6State==ACTIVATED){
display.fillCircle(50,30,5,WHITE);
}
if(button7State==ACTIVATED){
display.fillCircle(80,30,5,WHITE);
}
display.setCursor(0,0);
if(posx==MAZEHEIGHT){
posx=0;
posy=2;
displayLevelSplash();
level++;
illuminatedRow=0;
blinkPlayer=1;
wallPhase=1;
}else{
drawMaze();
}
display.display();
delay(10*DELAYMULTIPLIER);
}
void displayLevelSplash(){
int levely=-8,levelnoy=-8,completey=-8, i, j;
display.setTextColor(WHITE);
for(i=0;i<3;i++){
for(j=0;j<50;j+=2){
display.clearDisplay();
if(levely<20){
levely+=2;
tone(sound,levely*65,5);
}
if(levely==20 and levelnoy<30){
levelnoy+=2;
tone(sound,levelnoy*65,5);
}
if(levely==20 and levelnoy==30 and completey<40){
completey+=2;
tone(sound,completey*65,5);
}
display.setCursor(15,levely);
display.print("LEVEL");
display.setCursor(45,levelnoy);
display.print(level);
display.setCursor(55,completey);
display.print("COMPLETE!");
display.display();
}
}
delay(1000);
levely=-8;
levelnoy=-8;
for(i=0;i<2;i++){
for(j=0;j<50;j+=2){
display.clearDisplay();
if(levely<20){
levely+=2;
tone(sound,levely*65,5);
}
if(levely==20 and levelnoy<30){
levelnoy+=2;
tone(sound,levelnoy*65,5);
}
display.setCursor(15,levely);
display.print("LEVEL");
display.setCursor(45,levelnoy);
display.print(level+1);
display.display();
}
}
delay(1500);
generateMaze();
}
void drawMazeSerial(){
uint8_t i, j;
bool dot;
for(i=0;i<=MAZEHEIGHT;i++){
for(j=0;j<=MAZEWIDTH;j++){
dot=readPixel(i,j);
if(dot){
Serial.print("*");
}else{
Serial.print(" ");
}
}
Serial.println();
}
}
void drawMaze(){
uint8_t i, j;
bool wall;
for(i=0;i<=MAZEHEIGHT;i++){
for(j=0;j<=MAZEWIDTH;j++){
wall=readPixel(i,j);
if(wall){
//walls
if(wallPhase==1){
if(illuminatedRow>=i){
display.drawPixel(i*4,j*4,WHITE);
display.drawPixel(i*4,j*4+2,WHITE);
display.drawPixel(i*4+1,j*4+1,WHITE);
display.drawPixel(i*4+1,j*4+3,WHITE);
display.drawPixel(i*4+2,j*4+2,WHITE);
display.drawPixel(i*4+2,j*4+4,WHITE);
display.drawPixel(i*4+3,j*4+1,WHITE);
display.drawPixel(i*4+3,j*4+3,WHITE);
}else{
display.drawPixel(i*4+2,j*4+2,WHITE);
}
}else if(wallPhase==2){
if(illuminatedRow>=i){
display.fillRect(i*4,j*4,4,4,WHITE);
}else{
//display.drawRect(i*4,j*4,4,4,WHITE);
display.drawPixel(i*4,j*4,WHITE);
display.drawPixel(i*4,j*4+2,WHITE);
display.drawPixel(i*4+1,j*4+1,WHITE);
display.drawPixel(i*4+1,j*4+3,WHITE);
display.drawPixel(i*4+2,j*4+2,WHITE);
display.drawPixel(i*4+2,j*4+4,WHITE);
display.drawPixel(i*4+3,j*4+1,WHITE);
display.drawPixel(i*4+3,j*4+3,WHITE);
}
}else if(wallPhase==3){
display.fillRect(i*4,j*4,4,4,WHITE);
}
//display.drawBitmap(i*4, j*4, brick , 4, 4, WHITE);
if(wallPhase==3 and (i==posx or j==posy) and j!=0){
//draw crosshair
display.drawPixel(i*4+2,j*4+2,BLACK);
}
}else{
//not walls
if(wallPhase==3 and (i==posx or j==posy) and j!=0){
//draw crosshair
display.drawPixel(i*4+2,j*4+2,WHITE);
}
//display.drawBitmap(i*4, j*4, checker , 4, 4, WHITE);
/*display.drawPixel(i*4,j*4,WHITE);
display.drawPixel(i*4,j*4+2,WHITE);
display.drawPixel(i*4+1,j*4+1,WHITE);
display.drawPixel(i*4+1,j*4+3,WHITE);
display.drawPixel(i*4+2,j*4+2,WHITE);
display.drawPixel(i*4+2,j*4+4,WHITE);
display.drawPixel(i*4+3,j*4+1,WHITE);
display.drawPixel(i*4+3,j*4+3,WHITE);
*/
}
}
}
//display level
//display.fillRect(0,0,128,8,WHITE);
if(wallPhase>1){
display.setTextColor(BLACK);
display.setCursor(0,0);
display.print("level: ");
display.print(level);
}
//draw player
/*
display.drawPixel(posx*4,posy*4+1,WHITE);
display.drawPixel(posx*4,posy*4+2,WHITE);
display.drawPixel(posx*4+1,posy*4,WHITE);
display.drawPixel(posx*4+2,posy*4,WHITE);
display.drawPixel(posx*4+3,posy*4+1,WHITE);
display.drawPixel(posx*4+3,posy*4+2,WHITE);
display.drawPixel(posx*4+1,posy*4+3,WHITE);
display.drawPixel(posx*4+2,posy*4+3,WHITE);
*/
if(blinkPlayer==1){
display.fillCircle(posx*4+1,posy*4+1,3,WHITE);
display.fillCircle(posx*4+1,posy*4+1,1,BLACK);
}else{
display.fillCircle(posx*4+1,posy*4+1,3,BLACK);
display.fillCircle(posx*4+1,posy*4+1,1,WHITE);
}
/*
if(blinkPlayer==1){
display.drawPixel(posx*4+1,posy*4+1,WHITE);
}
if(blinkPlayer==2){
display.drawPixel(posx*4+2,posy*4+1,WHITE);
}
if(blinkPlayer==3){
display.drawPixel(posx*4+1,posy*4+2,WHITE);
}
if(blinkPlayer==4){
display.drawPixel(posx*4+2,posy*4+2,WHITE);
}
*/
blinkPlayer++;
if(blinkPlayer>16){
blinkPlayer=1;
}
if(illuminatedRow<MAZEHEIGHT+1){
illuminatedRow++;
}else{
if(wallPhase<3){
wallPhase++;
if(wallPhase==2){
illuminatedRow=0;
}
}
}
}
bool readPixel(uint8_t i, uint8_t j){
uint16_t Data = Maze[i];
byte Hi = (Data & 0xFF00)>>8;
byte Lo = Data & 0x00FF;
if(j>7){
return bitRead(Lo, 7 - (j % 8));
}else{
//j=j-8;
return bitRead(Hi, 7 - (j % 8));
}
}
void generateMaze(){
bool alternate=false;
for (geni = 1; geni < MAZEHEIGHT-1; geni++) {
if(!alternate){
Maze[geni] = 0b1100000000000001;
}else{
Maze[geni] = 0b1101010101010101;
}
alternate=!alternate;
}
genmod = 4;
for (geni = 2; geni < MAZEHEIGHT - 2; geni += 2) {
for (genj = 3; genj < MAZEWIDTH - 1; genj += 2) {
Maze[geni] |= (0x8000 >> genj);
do{
//Roll a stick
randomSeed(analogRead(A0));
//genval = (uint8_t)(analogRead(A0) & 0x00FF) % genmod;
genval = (uint8_t)(random(10000) & 0x00FF) % genmod;
//val = analogRead(A0) % mod;
genx = 0, geny = 0;
if (genval == 0)geny = 1;
if (genval == 1)genx = -1;
if (genval == 2)genx = 1;
if (genval == 3)geny = -1;
}while ((Maze[geni + geny] & (0x8000 >> (genj + genx))));
Maze[geni + geny] |= (0x8000 >> (genj + genx));
}
genmod = 3;
}
}