#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);
//const int ledPin = 13;
const uint8_t jmavi[1024] PROGMEM = {
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11110001,
0b11111111, 0b11111111, 0b11111111, 0b11111100, 0b00001111, 0b11100000, 0b00000111, 0b11111111, 0b11111111, 0b11111111, 0b11111101, 0b11111111, 0b10000000, 0b00000011, 0b10000000, 0b00000001,
0b11111111, 0b11111111, 0b11111000, 0b00000000, 0b00011100, 0b00000000, 0b00000111, 0b11111111, 0b10000000, 0b00000000, 0b11000001, 0b11111111, 0b10000000, 0b00000111, 0b00000000, 0b00000011,
0b11111111, 0b11111111, 0b11111000, 0b00000000, 0b00011100, 0b00000000, 0b00000111, 0b11111111, 0b00000000, 0b00000001, 0b11000001, 0b11111111, 0b10000000, 0b00000111, 0b00000000, 0b00000011,
0b11111111, 0b11111111, 0b11111000, 0b00000000, 0b00011000, 0b00000000, 0b00000111, 0b11111110, 0b00000000, 0b00000001, 0b10000001, 0b11111111, 0b00000000, 0b00000111, 0b00000000, 0b00000011,
0b11111111, 0b11111111, 0b11110000, 0b00000000, 0b00111000, 0b00000000, 0b00000011, 0b11111100, 0b00000000, 0b00000001, 0b10000001, 0b11111111, 0b00000000, 0b00001110, 0b00000000, 0b00000111,
0b11111111, 0b11111111, 0b11110000, 0b00000000, 0b00111000, 0b00000000, 0b00000011, 0b11111000, 0b00000000, 0b00000011, 0b10000000, 0b11111111, 0b00000000, 0b00001110, 0b00000000, 0b00000111,
0b11111111, 0b11111111, 0b11110000, 0b00000000, 0b00110000, 0b00000000, 0b00000011, 0b11110000, 0b00000000, 0b00000011, 0b00000000, 0b11111111, 0b00000000, 0b00001110, 0b00000000, 0b00000111,
0b11111111, 0b11111111, 0b11100000, 0b00000000, 0b01110000, 0b00000000, 0b00000011, 0b11110000, 0b00000000, 0b00000011, 0b00000000, 0b11111110, 0b00000000, 0b00011100, 0b00000000, 0b00001111,
0b11111111, 0b11111111, 0b11100000, 0b00000000, 0b01110000, 0b00000000, 0b00000001, 0b11100000, 0b00000000, 0b00000111, 0b00000000, 0b11111110, 0b00000000, 0b00011100, 0b00000000, 0b00001111,
0b11111111, 0b11111111, 0b11100000, 0b00000000, 0b01100000, 0b00000000, 0b00000001, 0b11000000, 0b00000000, 0b00000110, 0b00000000, 0b01111110, 0b00000000, 0b00011100, 0b00000000, 0b00001111,
0b11111111, 0b11111111, 0b11000000, 0b00000000, 0b11100000, 0b00000000, 0b00000001, 0b10000000, 0b00000000, 0b00000110, 0b00000000, 0b01111100, 0b00000000, 0b00111000, 0b00000000, 0b00001111,
0b11111111, 0b11111111, 0b11000000, 0b00000000, 0b11100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00001110, 0b00000000, 0b01111100, 0b00000000, 0b00111000, 0b00000000, 0b00011111,
0b11111111, 0b11111111, 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b00000000, 0b00001100, 0b00000000, 0b01111100, 0b00000000, 0b00111000, 0b00000000, 0b00011111,
0b11111111, 0b11111111, 0b10000000, 0b00000001, 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b00000000, 0b00001100, 0b00000000, 0b01111000, 0b00000000, 0b01110000, 0b00000000, 0b00011111,
0b11111111, 0b11111111, 0b10000000, 0b00000001, 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b00000000, 0b00011100, 0b00000000, 0b00111000, 0b00000000, 0b01110000, 0b00000000, 0b00111111,
0b11111111, 0b11111111, 0b10000000, 0b00000001, 0b10000000, 0b00000001, 0b11000000, 0b00000000, 0b00000000, 0b00011100, 0b00000000, 0b00111000, 0b00000000, 0b01110000, 0b00000000, 0b00111111,
0b11111111, 0b11111111, 0b00000000, 0b00000011, 0b10000000, 0b00000001, 0b11100000, 0b00000000, 0b00000000, 0b00011000, 0b00000000, 0b00111000, 0b00000000, 0b11100000, 0b00000000, 0b00111111,
0b11111111, 0b11111111, 0b00000000, 0b00000011, 0b10000000, 0b00000001, 0b11100000, 0b00000000, 0b00000000, 0b00111100, 0b00000000, 0b00111000, 0b00000000, 0b11100000, 0b00000000, 0b01111111,
0b11111111, 0b11111111, 0b00000000, 0b00000011, 0b00000000, 0b00000011, 0b11100000, 0b00110000, 0b00000000, 0b00111100, 0b00000000, 0b00111100, 0b00000000, 0b11100000, 0b00000000, 0b01111111,
0b11111111, 0b11111110, 0b00000000, 0b00000011, 0b00000000, 0b00000011, 0b11110000, 0b00110000, 0b00000000, 0b00111100, 0b00000000, 0b00011100, 0b00000001, 0b11000000, 0b00000000, 0b01111111,
0b11111111, 0b11111110, 0b00000000, 0b00000111, 0b00000000, 0b00000011, 0b11110000, 0b01100000, 0b00000000, 0b00111100, 0b00000000, 0b00011100, 0b00000001, 0b11000000, 0b00000000, 0b11111111,
0b11111111, 0b11111110, 0b00000000, 0b00000110, 0b00000000, 0b00000011, 0b11110000, 0b11100000, 0b00000000, 0b01111110, 0b00000000, 0b00011100, 0b00000001, 0b11000000, 0b00000000, 0b11111111,
0b11111111, 0b11111100, 0b00000000, 0b00000110, 0b00000000, 0b00000111, 0b11110001, 0b11100000, 0b00000000, 0b01111110, 0b00000000, 0b00011100, 0b00000001, 0b11000000, 0b00000000, 0b11111111,
0b11111111, 0b11111100, 0b00000000, 0b00001110, 0b00000000, 0b00000111, 0b11110011, 0b11000000, 0b00000000, 0b01111110, 0b00000000, 0b00001110, 0b00000011, 0b10000000, 0b00000001, 0b11111111,
0b11111111, 0b11111100, 0b00000000, 0b00001100, 0b00000000, 0b00000111, 0b11111111, 0b11000000, 0b00000000, 0b11111110, 0b00000000, 0b00001110, 0b00000011, 0b10000000, 0b00000001, 0b11111111,
0b11111111, 0b11111000, 0b00000000, 0b00001100, 0b00000000, 0b00001111, 0b11111111, 0b11000000, 0b00000000, 0b11111110, 0b00000000, 0b00001110, 0b00000011, 0b00000000, 0b00000001, 0b11111111,
0b11111111, 0b11111000, 0b00000000, 0b00011100, 0b00000000, 0b00001111, 0b11111111, 0b10000000, 0b00000000, 0b11000000, 0b00000000, 0b00001110, 0b00000111, 0b00000000, 0b00000011, 0b11111111,
0b11111111, 0b11111000, 0b00000000, 0b00011000, 0b00000000, 0b00001111, 0b11111111, 0b10000000, 0b00000001, 0b11000000, 0b00000000, 0b00001111, 0b00000111, 0b00000000, 0b00000011, 0b11111111,
0b11111111, 0b11110000, 0b00000000, 0b00011000, 0b00000000, 0b00011111, 0b11111111, 0b10000000, 0b00000001, 0b10000000, 0b00000000, 0b00000111, 0b00000111, 0b00000000, 0b00000011, 0b11111111,
0b11111111, 0b11110000, 0b00000000, 0b00111000, 0b00000000, 0b00011111, 0b11111111, 0b00000000, 0b00000001, 0b10000000, 0b00000000, 0b00000111, 0b00001110, 0b00000000, 0b00000111, 0b11111111,
0b11111111, 0b11110000, 0b00000000, 0b00110000, 0b00000000, 0b00011111, 0b11111111, 0b00000000, 0b00000011, 0b10000000, 0b00000000, 0b00000111, 0b00001110, 0b00000000, 0b00000111, 0b11111111,
0b11111111, 0b11110000, 0b00000000, 0b00110000, 0b00000000, 0b00111111, 0b11111111, 0b00000000, 0b00000011, 0b00000000, 0b00000000, 0b00000111, 0b00001110, 0b00000000, 0b00000111, 0b11111111,
0b11111111, 0b11100000, 0b00000000, 0b01110000, 0b00000000, 0b00111111, 0b11111110, 0b00000000, 0b00000011, 0b00000000, 0b00000000, 0b00000111, 0b10011100, 0b00000000, 0b00001111, 0b11111111,
0b11111111, 0b11000000, 0b00000000, 0b01100000, 0b00000000, 0b00111111, 0b11111110, 0b00000000, 0b00000111, 0b00000000, 0b00000000, 0b00000011, 0b10011100, 0b00000000, 0b00001111, 0b11111111,
0b11111100, 0b00000000, 0b00000000, 0b01100000, 0b00000000, 0b01111111, 0b11111110, 0b00000000, 0b00000110, 0b00000000, 0b00000000, 0b00000011, 0b10011100, 0b00000000, 0b00001111, 0b11111111,
0b10000000, 0b00000000, 0b00000000, 0b11100000, 0b00000000, 0b01111111, 0b11111100, 0b00000000, 0b00001110, 0b00000000, 0b00000000, 0b00000011, 0b10111000, 0b00000000, 0b00011111, 0b11111111,
0b00000000, 0b00000000, 0b00000000, 0b11000000, 0b00000000, 0b01111111, 0b11111100, 0b00000000, 0b00001111, 0b11111111, 0b11000000, 0b00000011, 0b10111000, 0b00000000, 0b00011111, 0b11111111,
0b10000000, 0b00000000, 0b00000000, 0b11000000, 0b00000000, 0b11111111, 0b11111100, 0b00000000, 0b00001111, 0b11111111, 0b11000000, 0b00000001, 0b11111000, 0b00000000, 0b00011111, 0b11111111,
0b10000000, 0b00000000, 0b00000001, 0b11000000, 0b00000000, 0b11111111, 0b11111100, 0b00000000, 0b00011111, 0b11111111, 0b11000000, 0b00000001, 0b11110000, 0b00000000, 0b00111111, 0b11111111,
0b10000000, 0b00000000, 0b00000001, 0b10000000, 0b00000000, 0b11111111, 0b11111000, 0b00000000, 0b00011111, 0b11111111, 0b11100000, 0b00000001, 0b11110000, 0b00000000, 0b01111111, 0b11111111,
0b10000000, 0b00000000, 0b00000001, 0b10000000, 0b01111111, 0b11111111, 0b11111000, 0b00000000, 0b00011111, 0b11111111, 0b11100000, 0b00000001, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b10000000, 0b00000000, 0b00001111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b10000000, 0b00000000, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b10000000, 0b00011111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b10000001, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b10011111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
};
const uint8_t image[1024] PROGMEM = {
0b10101010, 0b10101010, 0b10101010, 0b10101010, 0b10010010, 0b01010010, 0b01001001, 0b00100010, 0b00000100, 0b01001000, 0b10010001, 0b00010010, 0b01001001, 0b00100100, 0b10010010, 0b10010101,
0b01010101, 0b01010101, 0b01010101, 0b01010100, 0b10101010, 0b10010101, 0b00100100, 0b10010100, 0b10101001, 0b00100101, 0b00100100, 0b10100100, 0b10010010, 0b01001001, 0b01001010, 0b01010010,
0b10101010, 0b10101010, 0b10101001, 0b00100101, 0b01001001, 0b01001001, 0b01010010, 0b01000001, 0b00100010, 0b01001000, 0b10001010, 0b00010010, 0b00100100, 0b10010010, 0b00101001, 0b01001001,
0b01010101, 0b01010101, 0b01010101, 0b01010010, 0b00101010, 0b01010100, 0b01001001, 0b00010100, 0b01001000, 0b10000100, 0b01010001, 0b01001000, 0b10001001, 0b00100100, 0b10100101, 0b00101010,
0b10101010, 0b10101010, 0b10100101, 0b01011101, 0b01010010, 0b10001001, 0b00100100, 0b10100010, 0b00100010, 0b00101001, 0b00000100, 0b00100010, 0b01010010, 0b01001001, 0b00010010, 0b10100101,
0b01010101, 0b01010100, 0b10010100, 0b10110110, 0b10101001, 0b00100101, 0b01001001, 0b00001001, 0b00010001, 0b00000100, 0b10101001, 0b01001001, 0b00001000, 0b10010010, 0b10101000, 0b10010100,
0b10101010, 0b10100101, 0b01010101, 0b01011011, 0b01001010, 0b10101000, 0b00100100, 0b01010000, 0b10001010, 0b01010010, 0b00100100, 0b10010010, 0b01010010, 0b00100100, 0b01000101, 0b01010010,
0b01010100, 0b10010101, 0b01010101, 0b01101101, 0b01101000, 0b10000101, 0b01000010, 0b01000101, 0b00100001, 0b00100100, 0b10010010, 0b00100100, 0b10001001, 0b01001001, 0b00101010, 0b00101010,
0b10101010, 0b10101010, 0b10100100, 0b10101011, 0b10110110, 0b01010010, 0b00101001, 0b00010010, 0b01001000, 0b10001001, 0b00100001, 0b00010001, 0b00100010, 0b00010010, 0b10000001, 0b01000101,
0b01010010, 0b10101001, 0b00101010, 0b10110101, 0b01101010, 0b10010101, 0b01000100, 0b01001000, 0b10000100, 0b00100000, 0b10001010, 0b01001010, 0b01001000, 0b10100000, 0b01011010, 0b01010010,
0b01001010, 0b10010101, 0b01010100, 0b10101110, 0b11111010, 0b01001000, 0b00100001, 0b00100101, 0b00110111, 0b11010100, 0b00100100, 0b10010000, 0b10010010, 0b00010101, 0b00100101, 0b00101001,
0b10101010, 0b01010100, 0b10100010, 0b10101011, 0b10110101, 0b10100101, 0b01001010, 0b01001001, 0b01011010, 0b01100010, 0b10010001, 0b00100101, 0b00001001, 0b01000100, 0b10010000, 0b10010101,
0b01010101, 0b01010010, 0b10011010, 0b01010101, 0b11111110, 0b10010010, 0b00100100, 0b10010110, 0b11101011, 0b10101000, 0b01000100, 0b01000010, 0b01010010, 0b00101001, 0b01001010, 0b10100100,
0b10101010, 0b10101010, 0b10100101, 0b01011110, 0b11111010, 0b10101010, 0b10101001, 0b01011011, 0b10110101, 0b01000101, 0b00010010, 0b00010100, 0b01000100, 0b10010010, 0b00100101, 0b00101010,
0b01010100, 0b10010101, 0b01010100, 0b10100101, 0b10001010, 0b01010101, 0b01010101, 0b01101110, 0b11011101, 0b00101000, 0b10001001, 0b01001001, 0b00010001, 0b00100100, 0b10010010, 0b10100101,
0b01010010, 0b10101001, 0b00101010, 0b01011010, 0b11101010, 0b10101010, 0b10100100, 0b11011011, 0b10101010, 0b10000100, 0b01010000, 0b00100010, 0b01001010, 0b01001001, 0b01010100, 0b01010101,
0b10101010, 0b10100101, 0b01010010, 0b10001101, 0b10111101, 0b10101010, 0b01010010, 0b10111111, 0b01110100, 0b01010010, 0b10000101, 0b01001000, 0b10100001, 0b00100100, 0b10010010, 0b10010010,
0b01010101, 0b01011010, 0b10101010, 0b10101010, 0b11111111, 0b01100001, 0b01011101, 0b01000101, 0b11010101, 0b00101001, 0b00101000, 0b10000101, 0b00010100, 0b10010010, 0b01001010, 0b10101010,
0b10101011, 0b11101010, 0b10100101, 0b01011011, 0b01101111, 0b10010100, 0b11011111, 0b11111010, 0b10101001, 0b01000100, 0b01000101, 0b00101000, 0b01001010, 0b01001010, 0b10101001, 0b00101010,
0b11011111, 0b10111101, 0b10101010, 0b10101101, 0b10110101, 0b01001010, 0b01111111, 0b11101011, 0b01010100, 0b00100010, 0b10010000, 0b10010010, 0b10100101, 0b00101001, 0b00100101, 0b01010101,
0b11111000, 0b01110111, 0b11011010, 0b10101011, 0b01010101, 0b01010010, 0b10101010, 0b10110101, 0b10000010, 0b10010100, 0b01001010, 0b01001010, 0b00101000, 0b10100100, 0b10101010, 0b10101010,
0b11110101, 0b10101101, 0b01101101, 0b11110110, 0b11101101, 0b01010101, 0b01010110, 0b11010110, 0b01010000, 0b01000010, 0b10010010, 0b10100001, 0b10010101, 0b01010101, 0b01010100, 0b10010101,
0b11110100, 0b01110111, 0b11110111, 0b11011101, 0b10110110, 0b11111110, 0b10101101, 0b10111001, 0b00001010, 0b00010100, 0b00101001, 0b00010100, 0b01001010, 0b01010101, 0b01010010, 0b10100100,
0b11110111, 0b00111111, 0b11111111, 0b01110111, 0b11101101, 0b11100101, 0b11011011, 0b01100101, 0b00100001, 0b01001010, 0b10100100, 0b10101011, 0b01010010, 0b10100101, 0b01001101, 0b01010101,
0b11111111, 0b11111111, 0b11111010, 0b11011101, 0b11011111, 0b01111111, 0b01111101, 0b10111010, 0b10001000, 0b00100010, 0b01010010, 0b01010100, 0b10101010, 0b10010101, 0b01010010, 0b10101010,
0b00000000, 0b01000011, 0b11001011, 0b01010111, 0b11111110, 0b11101101, 0b11110111, 0b10101010, 0b10100101, 0b00010001, 0b00010001, 0b01001010, 0b10101010, 0b10101010, 0b10101101, 0b01000100,
0b10110101, 0b00101010, 0b10111010, 0b10101010, 0b10111111, 0b11111111, 0b10101110, 0b11010101, 0b01010000, 0b10001010, 0b01001101, 0b00100010, 0b10101010, 0b10110101, 0b01101010, 0b10101010,
0b01001010, 0b10101011, 0b11101111, 0b10110101, 0b01010010, 0b10110110, 0b11010101, 0b01010101, 0b00101010, 0b01010001, 0b00100010, 0b10001000, 0b01010101, 0b01010111, 0b10110101, 0b00101010,
0b01010010, 0b10110110, 0b10111101, 0b01010110, 0b10101101, 0b01010101, 0b01010101, 0b01010100, 0b11001010, 0b10001001, 0b01011001, 0b00100101, 0b00000101, 0b01010101, 0b01010100, 0b10100101,
0b01001010, 0b11011011, 0b11111110, 0b11101010, 0b11010101, 0b10101010, 0b10101010, 0b01010010, 0b10100101, 0b01010100, 0b10001010, 0b01010010, 0b10110101, 0b01010110, 0b11101011, 0b01010100,
0b01010111, 0b01010110, 0b11101111, 0b11111011, 0b01010101, 0b01010101, 0b01010101, 0b01001010, 0b01010010, 0b01001010, 0b01010001, 0b00001000, 0b10001001, 0b01010101, 0b10101010, 0b01010010,
0b10101101, 0b01101101, 0b11111111, 0b01101101, 0b10110110, 0b10101010, 0b10101001, 0b00101010, 0b10001010, 0b10100101, 0b01001101, 0b01101010, 0b01101010, 0b10110110, 0b11101010, 0b10101010,
0b01010101, 0b10110111, 0b11111111, 0b11111011, 0b01011010, 0b10101010, 0b10010100, 0b10100101, 0b01010100, 0b10010101, 0b00100100, 0b10010101, 0b01010101, 0b01011011, 0b10110101, 0b01010101,
0b01010110, 0b10101010, 0b11111111, 0b10111110, 0b11101011, 0b01101101, 0b01010010, 0b10101001, 0b00100010, 0b01010100, 0b10110101, 0b01010101, 0b01010110, 0b11101101, 0b01110110, 0b10101010,
0b10101011, 0b01111111, 0b01001011, 0b11110111, 0b11111101, 0b10110101, 0b01001010, 0b10101010, 0b10101010, 0b10101011, 0b01001010, 0b10101010, 0b10101011, 0b01011011, 0b11011011, 0b01010101,
0b10111101, 0b10100101, 0b10101010, 0b11111010, 0b10101110, 0b11010101, 0b01010101, 0b01010101, 0b01010101, 0b01101010, 0b10101010, 0b10101010, 0b10101010, 0b11111110, 0b11111010, 0b10101010,
0b11010110, 0b11111110, 0b10101010, 0b11011111, 0b11111011, 0b10111010, 0b10101010, 0b10010010, 0b10010010, 0b10101010, 0b10110101, 0b01010101, 0b01010101, 0b10101101, 0b10101110, 0b11010101,
0b11101011, 0b10101010, 0b10101011, 0b01110101, 0b11111111, 0b11101010, 0b10101010, 0b10101010, 0b10101101, 0b01011010, 0b10101010, 0b10101010, 0b10111010, 0b10110111, 0b11011011, 0b01101010,
0b10111110, 0b11111110, 0b10101010, 0b11111111, 0b01101111, 0b10101010, 0b10101010, 0b10101010, 0b10101010, 0b11101010, 0b10101011, 0b01101101, 0b11001110, 0b11011010, 0b11111101, 0b10110111,
0b01111111, 0b11101001, 0b01010111, 0b01111111, 0b11111101, 0b01010110, 0b10101010, 0b10101101, 0b01010111, 0b01010101, 0b01101101, 0b10110110, 0b01110101, 0b10111111, 0b10110111, 0b01011010,
0b10000010, 0b10101010, 0b10101001, 0b10101111, 0b11010110, 0b11011010, 0b11010101, 0b01101010, 0b11101101, 0b01010110, 0b10101010, 0b10101011, 0b10101011, 0b01101011, 0b11111101, 0b11101011,
0b01101010, 0b01010101, 0b01010110, 0b10111110, 0b11111011, 0b01101101, 0b01101110, 0b11011101, 0b01011011, 0b01101011, 0b01101101, 0b10110101, 0b01111101, 0b11011110, 0b11111111, 0b01011101,
0b00101001, 0b01001010, 0b10101001, 0b01101111, 0b10101101, 0b10110111, 0b10111011, 0b10110111, 0b11110110, 0b11011101, 0b10110110, 0b11011110, 0b11010111, 0b01111111, 0b11011011, 0b11101010,
0b10101010, 0b10101001, 0b01010110, 0b11111101, 0b11111111, 0b11111101, 0b11101111, 0b11111101, 0b10111011, 0b01101010, 0b11011011, 0b01101011, 0b10111011, 0b11101101, 0b11111110, 0b10111111,
0b01010101, 0b01010101, 0b01010101, 0b10111111, 0b10110110, 0b10101111, 0b10111110, 0b11011111, 0b11101111, 0b10111110, 0b10101101, 0b10111101, 0b11101110, 0b11111111, 0b11111111, 0b11101010,
0b10101010, 0b10101010, 0b10101010, 0b11110110, 0b11111101, 0b11111101, 0b11111111, 0b11111110, 0b11111010, 0b11101011, 0b11110110, 0b11101111, 0b01111111, 0b10111111, 0b11111011, 0b01111101,
0b01010101, 0b01010101, 0b01010101, 0b00101111, 0b11111111, 0b11111111, 0b11111111, 0b11110111, 0b10111111, 0b10111101, 0b01011111, 0b10111011, 0b11011011, 0b11110111, 0b01111111, 0b11101111,
0b10101010, 0b10101010, 0b11011111, 0b11111111, 0b11101111, 0b11111111, 0b11111110, 0b11011111, 0b11101011, 0b11101111, 0b11110101, 0b11101110, 0b11111111, 0b11111111, 0b11111101, 0b10111010,
0b01010101, 0b01010101, 0b01010001, 0b01011111, 0b11111111, 0b11111111, 0b11111111, 0b11111101, 0b10111110, 0b11111011, 0b01111111, 0b01111111, 0b11111110, 0b11111111, 0b11111111, 0b11111111,
0b10100100, 0b10101010, 0b10101101, 0b01010010, 0b10111111, 0b11111111, 0b11111011, 0b11111111, 0b11111111, 0b10111111, 0b11011101, 0b11101101, 0b11011011, 0b11101111, 0b11111111, 0b01101111,
0b01010101, 0b01010101, 0b01010010, 0b10101101, 0b01010111, 0b11111111, 0b11101111, 0b11101111, 0b11110110, 0b11101101, 0b11110111, 0b10111111, 0b11111111, 0b11111111, 0b11111111, 0b11111101,
0b10101010, 0b10101010, 0b10101010, 0b10101010, 0b10111010, 0b11111111, 0b11111111, 0b11111110, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b01111111, 0b11111111, 0b11111111, 0b10111111,
0b01010101, 0b01010101, 0b01010101, 0b01010101, 0b01010111, 0b01011111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b01101101, 0b11101101, 0b11111111, 0b11111111, 0b11111111, 0b11110111,
0b10101010, 0b10101010, 0b10101010, 0b10110110, 0b11101011, 0b11111111, 0b11111111, 0b11111111, 0b11101111, 0b10111101, 0b11111111, 0b01111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b10110110, 0b11010101, 0b10111011, 0b11011011, 0b01011101, 0b11110110, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11011011,
0b01011011, 0b01101110, 0b11010110, 0b01101101, 0b11111111, 0b11011111, 0b11111111, 0b11111111, 0b11111111, 0b11110111, 0b11011011, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b10101010, 0b10101010, 0b10101101, 0b11110111, 0b11111111, 0b01111011, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11110111,
0b10101010, 0b10101010, 0b10110110, 0b10111101, 0b01110101, 0b11101111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111110,
0b10110101, 0b01010101, 0b01010101, 0b01001011, 0b11011111, 0b01111011, 0b01111111, 0b11111111, 0b11111111, 0b01111111, 0b11111111, 0b11111111, 0b11111111, 0b11101101, 0b10110111, 0b11111011,
0b01010110, 0b11011010, 0b10101010, 0b10110101, 0b01101101, 0b11011111, 0b11011111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b01111111, 0b11111111, 0b11111111,
0b11011010, 0b10101010, 0b11010101, 0b01010110, 0b10110110, 0b11101010, 0b11110101, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11010101, 0b01101101, 0b11111111,
0b01010101, 0b01010101, 0b01010101, 0b01010101, 0b01010101, 0b10111111, 0b01011111, 0b01011011, 0b11011111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b10111111,
0b10101101, 0b10110110, 0b10101101, 0b01010101, 0b01101110, 0b11010101, 0b11110101, 0b11101110, 0b11110110, 0b11011111, 0b11111111, 0b11111111, 0b11101101, 0b11101101, 0b01010110, 0b11111110,
0b11010110, 0b10101010, 0b11010101, 0b01010101, 0b10101010, 0b10101111, 0b01011110, 0b10111011, 0b10111111, 0b11111101, 0b11111111, 0b11111011, 0b01111111, 0b01111111, 0b11111111, 0b11110111,
};
// Define cube vertices
float vertices[8][3] = {
{-10, -13.66, -3.66},
{ 10, -13.66, -3.66},
{ 10, 3.66, -13.66},
{-10, 3.66, -13.66},
{-10, -3.66, 13.66},
{ 10, -3.66, 13.66},
{ 10, 13.66, 3.66},
{-10, 13.66, 3.66}
};
// Define edges that connect vertices
int edges[12][2] = {
{0, 1}, {1, 2}, {2, 3}, {3, 0},
{4, 5}, {5, 6}, {6, 7}, {7, 4},
{0, 4}, {1, 5}, {2, 6}, {3, 7}
};
// Define new vertices array to store updated coordinates
float newVertices[8][3];
//float finalVertices[8][3];
int counter = 0;
void setup() {
// Initialize the display
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;);
}
display.clearDisplay();
display.invertDisplay(true);
display.drawBitmap(0,0,image,128,64,2);
display.display();
delay(3000);
// Clear the display buffer
display.clearDisplay();
display.drawBitmap(0,0,jmavi,128,64,2);
display.display();
delay(3000);
display.invertDisplay(false);
display.clearDisplay();
//scrolljmavi();
//pinMode(ledPin, OUTPUT);
}
void loop() {
// Clear the display buffer
display.clearDisplay();
/*
if(counter==30){
display.invertDisplay(true);
display.display();
//digitalWrite(ledPin, HIGH);
}
*/
/*
if(counter==60){
display.invertDisplay(false);
display.display();
//digitalWrite(ledPin, LOW);
counter=0;
}
*/
// Rotate cube around Y axis
static float angleY = 0.0;
angleY += 0.1;
// Rotate cube around X axis
// static float angleX = 0.0;
// angleX += 0.05;
// Calculate rotation matrix for Y axis
float cosY = cos(angleY);
float sinY = sin(angleY);
float rotationMatrixY[3][3] = {
{cosY, 0, sinY},
{0, 1, 0},
{-sinY, 0, cosY}
};
// Calculate rotation matrix for X axis
/*
float cosX = cos(angleX);
float sinX = sin(angleX);
float rotationMatrixX[3][3] = {
{1, 0, 0},
{0, cosX, -sinX},
{0, sinX, cosX}
};
*/
// Transform vertices and store them in newVertices array
for (int i = 0; i < 8; i++) {
multiplyVectorMatrix(vertices[i],rotationMatrixY, newVertices[i]);
//multiplyVectorMatrix2(newVertices[i],rotationMatrixX, finalVertices[i]);
//newVertices[i][0] = rotationMatrixY[0][0] * vertices[i][0] + rotationMatrixY[0][1] * vertices[i][1] + rotationMatrixY[0][2] * vertices[i][2];
//newVertices[i][1] = rotationMatrixY[1][0] * vertices[i][0] + rotationMatrixY[1][1] * vertices[i][1] + rotationMatrixY[1][2] * vertices[i][2];
//newVertices[i][2] = rotationMatrixY[2][0] * vertices[i][0] + rotationMatrixY[2][1] * vertices[i][1] + rotationMatrixY[2][2] * vertices[i][2];
}
/* for (int i = 0; i < 8; i++) {
multiplyVectorMatrix(newVertices[i],rotationMatrixX, finalVertices[i]);
newVertices2[i][0] = rotationMatrixX[0][0] * newVertices[i][0] + rotationMatrixX[0][1] * newVertices[i][1] + rotationMatrixX[0][2] * newVertices[i][2];
newVertices2[i][1] = rotationMatrixX[1][0] * newVertices[i][0] + rotationMatrixX[1][1] * newVertices[i][1] + rotationMatrixX[1][2] * newVertices[i][2];
newVertices2[i][2] = rotationMatrixX[2][0] * newVertices[i][0] + rotationMatrixX[2][1] * newVertices[i][1] + rotationMatrixX[2][2] * newVertices[i][2];
}
*/
// Draw edges connecting vertices from newVertices array
for (int i = 0; i < 12; i++) {
int v1 = edges[i][0];
int v2 = edges[i][1];
int y1p = SCREEN_HEIGHT / 2 + newVertices[v1][1]+15;
int y2p = SCREEN_HEIGHT / 2 + newVertices[v2][1] +15;
int x1p = SCREEN_WIDTH / 2 + newVertices[v1][0] ;
int x2p = SCREEN_WIDTH / 2 + newVertices[v2][0] ;
display.drawLine(x1p-32, y1p, x2p-32, y2p, SSD1306_WHITE);
display.drawLine(x1p+32, y1p, x2p+32, y2p, SSD1306_WHITE);
display.drawLine(x1p, y1p, x2p, y2p, SSD1306_WHITE);
display.drawLine(x1p-16, y1p-30, x2p-16, y2p-30, SSD1306_WHITE);
display.drawLine(x1p+16, y1p-30, x2p+16, y2p-30, SSD1306_WHITE);
}
// Display the updated frame
display.display();
counter+=1;
delay(1); // Adjust the delay to control rotation speed
}
void multiplyVectorMatrix(float vector[], float matrix[][3], float result[]) {
for (int i = 0; i < 3; ++i) {
result[i] = 0.0;
for (int j = 0; j < 3; ++j) {
result[i] += vector[j] * matrix[i][j];
}
}
}
void multiplyVectorMatrix2(float vector[], float matrix[][3], float result[]) {
for (int i = 0; i < 3; ++i) {
result[i] = 0.0;
for (int j = 0; j < 3; ++j) {
result[i] += vector[j] * matrix[i][j];
}
}
}
void testscrolltext(void) {
display.clearDisplay();
display.setTextSize(2); // Draw 2X-scale text
display.setTextColor(WHITE);
display.setCursor(10, 0);
display.println(F("1"));
display.setCursor(10, 16);
display.println(F("2"));
display.setCursor(10, 32);
display.println(F("3"));
display.setCursor(10, 48);
display.println(F("4"));
display.display(); // Show initial text
delay(100);
// Scroll in various directions, pausing in-between:
display.startscrollright(0x00, 0x0F);
delay(2000);
display.stopscroll();
delay(1000);
display.startscrollleft(0x00, 0x0F);
delay(2000);
display.stopscroll();
delay(1000);
display.startscrolldiagright(0x00, 0x07);
delay(2000);
display.startscrolldiagleft(0x00, 0x07);
delay(2000);
display.stopscroll();
delay(1000);
}
void scrolljmavi(void){
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(10, 20);
// Display static text
display.println("JMAVI");
display.setCursor(40, 50);
// Display static text
display.println("JMAVI");
display.setCursor(70, 20);
// Display static text
display.println("JMAVI");
display.display();
display.startscrolldiagright(0x00, 0x07);
delay(5000);
display.stopscroll();
}