feat: add functions to Face class

This commit is contained in:
DinoMalin 2025-03-05 01:55:40 +01:00
parent 4068f02fb2
commit a3dfc57a73
3 changed files with 28 additions and 3 deletions

View File

@ -8,5 +8,8 @@ private:
public: public:
void blink(); void blink();
void drawEyes(); void drawEyes();
void drawLeftSideEye();
void drawRightSideEye();
void defaultPos();
Face(LCD lcd); Face(LCD lcd);
}; };

View File

@ -23,3 +23,18 @@ void Face::drawEyes() {
lcd.drawRectangle(x+7, 1); lcd.drawRectangle(x+7, 1);
lcd.drawRectangle(x+8, 1); lcd.drawRectangle(x+8, 1);
} }
void Face::drawLeftSideEye() {
this->x = 1;
drawEyes();
}
void Face::drawRightSideEye() {
this->x = 6;
drawEyes();
}
void Face::defaultPos() {
this->x = 3;
drawEyes();
}

View File

@ -36,12 +36,19 @@ void loop() {
face.drawEyes(); face.drawEyes();
delay(1200); delay(1200);
face.drawLeftSideEye();
delay(500);
face.drawRightSideEye();
delay(500);
face.defaultPos();
face.drawEyes();
delay(800);
face.blink(); face.blink();
delay(300); delay(300);
face.drawEyes();
delay(1200);
Serial.print("[CMD]"); Serial.print("[CMD]");
Serial.println("[firefox --new-window 'https://www.terre-plate.org/terre-plate-preuve-ultime/']"); Serial.println("[firefox --new-window 'https://www.terre-plate.org/terre-plate-preuve-ultime/']");
Serial.print("[CMD]"); Serial.print("[CMD]");