diff options
-rw-r--r-- | main/constants.h | 3 | ||||
-rw-r--r-- | main/main.ino | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/main/constants.h b/main/constants.h index ea1d31e..2021916 100644 --- a/main/constants.h +++ b/main/constants.h @@ -1,11 +1,12 @@ #define SERIAL_BAUD 115200 #define MAX_CODE_LEN 64 -#define KB_DEBOUNCE_DELAY 100 +#define KB_DEBOUNCE_DELAY 500 #define BUZZ_OPEN 1000 #define BUZZ_WRONG 700 #define BUZZ_NUM 1200 #define BUZZ_CLEAR 900 +#define BUZZ_SET 1500 #define PINOUT_KBM7 4 #define PINOUT_KBM6 5 diff --git a/main/main.ino b/main/main.ino index e084af1..0ea294b 100644 --- a/main/main.ino +++ b/main/main.ino @@ -141,6 +141,18 @@ void correct_code_routine() { clear_code(); } +/** @brief wordt uitgevoerd als de code is veranderd */ +void set_code_buzz() { + digitalWrite(PINOUT_LED_G, HIGH); + for(int i = 0; i < 3; i++) { + tone(PINOUT_BUZZ, BUZZ_SET); + delay(50); + noTone(PINOUT_BUZZ); + delay(50); + } + digitalWrite(PINOUT_LED_G, LOW); +} + /** @brief wordt uitgevoerd wanneer "E" wordt ingedrukt */ void check_code() { bool correct = true; @@ -194,6 +206,7 @@ void kb_onevent(kb_event ev) { correct_code_len = codei; clear_code(); set_mode = false; + set_code_buzz(); } break; @@ -203,6 +216,9 @@ void kb_onevent(kb_event ev) { clear_code(); set_mode = true; + tone(PINOUT_BUZZ, BUZZ_SET, 100); + led_set_timeout(LED_G, 100); + break; } |