arduino stuffs
Diffstat (limited to 'mp3player/arduino/error.h')
| -rw-r--r-- | mp3player/arduino/error.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mp3player/arduino/error.h b/mp3player/arduino/error.h new file mode 100644 index 0000000..eb30a2f --- /dev/null +++ b/mp3player/arduino/error.h @@ -0,0 +1,29 @@ +#ifndef ERR_H +#define ERR_H + +#include "display/display.h" + +#define ERR_LIGHT 12 + +class Error { +public: + Error(String err) { + Serial.println("err: " + err); + OLED::clear(); + OLED::println("err: " + err); + OLED::flush(); + blink_err_light(); + }; + +private: + void blink_err_light() { + pinMode(ERR_LIGHT, OUTPUT); + while (true) { + digitalWrite(ERR_LIGHT, HIGH); + delay(100); + digitalWrite(ERR_LIGHT, LOW); + delay(100); + } + } +}; +#endif
\ No newline at end of file |