Robot expression ( ecran OLED ) : Différence entre versions

De Les Fabriques du Ponant
Aller à : navigation, rechercher
(montage electronique)
(premiere partie du code arduino)
Ligne 15 : Ligne 15 :
 
<big>attention , il faut rajouter un onglet au code avec la partie eyes.h</big>
 
<big>attention , il faut rajouter un onglet au code avec la partie eyes.h</big>
  
 +
<syntaxhighlight lang="Arduino" line>
 
#include <Wire.h>
 
#include <Wire.h>
 
#include <Adafruit_GFX.h>
 
#include <Adafruit_GFX.h>
Ligne 127 : Ligne 128 :
  
 
}
 
}
 
+
</syntaxhighlight>
  
 
=== deuxieme partie du code arduino ===
 
=== deuxieme partie du code arduino ===

Version du 13 mai 2024 à 13:58

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>
  4 
  5 #define SCREEN_WIDTH 128 // OLED display width, in pixels
  6 #define SCREEN_HEIGHT 64 // OLED display height, in pixels
  7 // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
  8 #define OLED_RESET     -1 // Reset pin # (or -1 if sharing Arduino reset pin)
  9 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
 10 
 11 #include "eyes.h"
 12 
 13 void setup() {
 14   // put your setup code here, to run once:
 15   pinMode(8,INPUT_PULLUP);
 16   pinMode(9,INPUT_PULLUP);
 17   pinMode(10,INPUT_PULLUP);
 18   pinMode(11,INPUT_PULLUP);
 19   
 20   Serial.begin(115200);
 21   Serial.println("Booting");
 22 
 23   if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3c)) { // Address 0x3D for 128x64
 24     Serial.println(F("SSD1306 allocation failed"));
 25     for(;;); // Don't proceed, loop forever
 26   }
 27 
 28   // Show initial display buffer contents on the screen --
 29   // the library initializes this with an Adafruit splash screen.
 30   display.display();
 31   
 32   // Clear the buffer
 33   display.clearDisplay();
 34   display.display();
 35 }
 36 
 37 unsigned char readkey(void){ 
 38   unsigned char ret=0;
 39     if (digitalRead(8)==0 ) ret=1;  //izquierda
 40     if (digitalRead(9)==0) ret+=2; //arriba
 41     if (digitalRead(10)==0) ret+=4; //abajo
 42     if (digitalRead(11)==0) ret+=8; //fuego
 43   return (ret);
 44 }
 45 
 46 int xp=16;
 47 int mood=1;
 48 
 49 void loop() {
 50   int n;
 51   static int xd=0;
 52   static int espera=0;
 53   static int step=0;
 54   int x1,x2;
 55   if (espera>0) {
 56     espera--;
 57     delay(1);
 58   } else {
 59     x1=   xd+ (xp>16? (16+2*(xp-16)):xp);
 60     x2=64+xd+ (xp<16? (-16+(xp*2))  :xp);
 61     switch (step){
 62       case 0:
 63        display.clearDisplay(); // Clear the display buffer
 64        if (xp<6) { 
 65                display.drawBitmap(x1, 8, peyes[mood][2][0], 32, 32, WHITE);
 66                display.drawBitmap(x2, 8, peyes[mood][1][1], 32, 32, WHITE);
 67        } else if (xp<26) {
 68                display.drawBitmap(x1, 8, peyes[mood][0][0], 32, 32, WHITE);
 69                display.drawBitmap(x2, 8, peyes[mood][0][1], 32, 32, WHITE); 
 70        } else {
 71                display.drawBitmap(x1, 8, peyes[mood][1][0], 32, 32, WHITE); 
 72                display.drawBitmap(x2, 8, peyes[mood][2][1], 32, 32, WHITE);
 73        }
 74        display.display();
 75        espera=random(250, 1000);
 76        n=random(0,7);
 77        if (n==6) {
 78           step=1;
 79        } else {
 80           step=2;
 81        }
 82        break;
 83       case 1:
 84        display.clearDisplay(); // Clear the display buffer
 85        display.drawBitmap(x1, 8, eye0, 32, 32, WHITE);
 86        display.drawBitmap(x2, 8, eye0, 32, 32, WHITE);
 87        display.display();
 88        espera=100;
 89        step=0;
 90        break;
 91       case 2:
 92        n=random(0,10);
 93        if (n<5) xd--;
 94        if (n>5) xd++;
 95        if (xd<-4) xd=-3;
 96        if (xd>4) xd=3; 
 97        espera=0;
 98        step=0;
 99        break;
100     }
101   }
102 //n=0;
103 n=readkey();
104 if (n==2) xp=(xp<=0?0:xp-1); 
105 if (n==4) xp=(xp>=32?32:xp+1);
106 if (n==1) {
107   mood=(mood>=5?0:mood+1);
108   do {} while (readkey()!=0);
109   }
110 if (n!=0) { espera=0; step=0; }
111 
112 }

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