diff --git a/super_simon/include/utils.h b/super_simon/include/utils.h index e36ac35..d6893b1 100644 --- a/super_simon/include/utils.h +++ b/super_simon/include/utils.h @@ -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 diff --git a/super_simon/src/utils.cpp b/super_simon/src/utils.cpp index abc87fc..3e530fa 100644 --- a/super_simon/src/utils.cpp +++ b/super_simon/src/utils.cpp @@ -65,6 +65,7 @@ bool userSequence(const byte sequence[], byte upTo) { } else { error(); + blink(expectedButton); return false; } } @@ -97,4 +98,13 @@ void endGame(LiquidCrystal lcd, bool win, byte score) { lcd.setCursor(0, 1); lcd.print(score); delay(10000); -} \ No newline at end of file +} + +void blink(byte index) { + for (byte i = 0; i < 3; i++) { + digitalWrite(LEDS[index], HIGH); + delay(100); + digitalWrite(LEDS[index], LOW); + delay(100); + } +}