#include <LiquidCrystal.h>
byte happy1[8] = {
B01111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111
};
byte happy2[8] = {
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111
};
byte happy3[8] = {
B11110,
B11111,
B10011,
B10011,
B11111,
B11111,
B11111,
B11111
};
byte happy4[8] = {
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B01111
};
byte happy5[8] = {
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11110
};
byte* HappyEyes[5] = {happy1, happy2, happy3, happy4, happy5};
byte side1[8] = {
B00000,
B00000,
B00000,
B00000,
B01111,
B11111,
B11111,
B11111
};
byte side2[8] = {
B00000,
B00000,
B00000,
B00000,
B11110,
B11111,
B11111,
B11111
};
byte side3[8] = {
B11111,
B11111,
B11111,
B01111,
B00000,
B00000,
B00000,
B00000
};
byte side4[8] = {
B11111,
B11111,
B11111,
B11110,
B00000,
B00000,
B00000,
B00000
};
byte side5[8] = {
B00000,
B00000,
B00000,
B00000,
B11111,
B11111,
B11111,
B11111
};
byte side6[8] = {
B11111,
B11111,
B11111,
B11111,
B00000,
B00000,
B00000,
B00000
};
byte* SideEye[6] = {side1,side2,side3,side4, side5, side6} ;
LiquidCrystal lcd(1, 2, 4, 5, 6, 7);
void setup() {
lcd.begin(16, 2);
// setupHappyEye();
// showHappyEye(2);
// showHappyEye(11);
setupSideEye();
// showSideEye(0);
}
void loop() {
for(int i = 0; i<8;i++){
lcd.clear();
showSideEye(i+0);
showSideEye(i+6);
delay(80);
}
for(int i = 7; i>=0;i--){
lcd.clear();
showSideEye(i+0);
showSideEye(i+6);
delay(80);
}
}
void setupSideEye(){
for(int i = 0; i<6;i++) lcd.createChar(i,SideEye[i]);
}
void showSideEye(int start){
lcd.setCursor(start+0,0);
lcd.write(byte(0));
lcd.setCursor(start+1,0);
lcd.write(byte(4));
lcd.setCursor(start+2,0);
lcd.write(byte(1));
lcd.setCursor(start+0,1);
lcd.write(byte(2));
lcd.setCursor(start+1,1);
lcd.write(byte(5));
lcd.setCursor(start+2,1);
lcd.write(byte(3));
}
void setupHappyEye(){
for(int i = 0; i<5;i++) lcd.createChar(i,HappyEyes[i]);
}
void showHappyEye(int start){
lcd.setCursor(start+0,0);
lcd.write(byte(0));
lcd.setCursor(start+1,0);
lcd.write(byte(1));
lcd.setCursor(start+2,0);
lcd.write(byte(2));
lcd.setCursor(start+0,1);
lcd.write(byte(3));
lcd.setCursor(start+1,1);
lcd.write(byte(1));
lcd.setCursor(start+2,1);
lcd.write(byte(4));
}