Robot expression ( ecran OLED )

De Les Fabriques du Ponant
Révision datée du 7 mai 2024 à 08:18 par Antonydbzh (discussion | contributions) (sources)
Aller à : navigation, rechercher

Robot expression ( ecran OLED )

pour animer un robot / un petit bot ou autre , je vous propose le tutoriel suivant qui permet grace à des boutons poussoirs de choisir l'expression des yeux du robot.

materiel

  • arduino uno + cable usb
  • cables dupont M-M
  • ecan oled 128*64
  • 3 boutons poussoirs

montage electronique

Schema electronique ecran oled.png

premiere partie du code arduino

attention , il faut rajouter un onglet au code avec la partie eyes.h

  1. include <Wire.h>
  2. include <Adafruit_GFX.h>
  3. include <Adafruit_SSD1306.h>
  1. define SCREEN_WIDTH 128 // OLED display width, in pixels
  2. define SCREEN_HEIGHT 64 // OLED display height, in pixels

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)

  1. define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

  1. include "eyes.h"

void setup() {

 // put your setup code here, to run once:
 pinMode(8,INPUT_PULLUP);
 pinMode(9,INPUT_PULLUP);
 pinMode(10,INPUT_PULLUP);
 pinMode(11,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(8)==0 ) ret=1;  //izquierda
   if (digitalRead(9)==0) ret+=2; //arriba
   if (digitalRead(10)==0) ret+=4; //abajo
   if (digitalRead(11)==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; }

}


deuxieme partie du code arduino

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} },

};

sources