Blink expected button on error
This commit is contained in:
parent
b78ff4f184
commit
b9035d0473
2 changed files with 12 additions and 1 deletions
|
@ -15,5 +15,6 @@ byte waitForButton();
|
|||
void error();
|
||||
void endGame(LiquidCrystal lcd, bool win, byte score);
|
||||
void configure();
|
||||
void blink(byte index);
|
||||
|
||||
#endif //SUPER_SIMON_UTILS_H
|
||||
|
|
|
@ -65,6 +65,7 @@ bool userSequence(const byte sequence[], byte upTo) {
|
|||
}
|
||||
else {
|
||||
error();
|
||||
blink(expectedButton);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -98,3 +99,12 @@ void endGame(LiquidCrystal lcd, bool win, byte score) {
|
|||
lcd.print(score);
|
||||
delay(10000);
|
||||
}
|
||||
|
||||
void blink(byte index) {
|
||||
for (byte i = 0; i < 3; i++) {
|
||||
digitalWrite(LEDS[index], HIGH);
|
||||
delay(100);
|
||||
digitalWrite(LEDS[index], LOW);
|
||||
delay(100);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue