1
0
Fork 0

LCD: Introduce LCD display and animations

Add support for the LCD and using it for displaying animations.
Animations are automatically played if available for the ID of the
detected tag.

The code should support adding other kind of animations, for tags being
removed or for other UI interactions for example.
This commit is contained in:
trotFunky 2023-10-21 22:01:10 +01:00
parent 92a186f752
commit 005f4e1bea
4 changed files with 127 additions and 3 deletions

View file

@ -3,6 +3,7 @@
#include "Pinout.h"
#include "Com.h"
#include "LCD.h"
#include "RFID.h"
__attribute__((noreturn)) int main() {
@ -44,15 +45,27 @@ __attribute__((noreturn)) int main() {
digitalWrite(pin_NFC1_RST, HIGH);
rfid.init();
if (!SD.begin(BUILTIN_SDCARD))
Com::sendComment("Could not use the SD Card.");
LCD lcd;
digitalWrite(pin_LCD_RST, HIGH);
lcd.init();
/* Main loop */
while (true) {
int8_t tagEvent;
/* Display first, in case the RFID communication delays it too much. */
lcd.checkAndDisplay();
tagEvent = rfid.checkTags();
if (tagEvent) {
Com::sendFigUpdate(tagEvent);
lcd.startNewAnim(tagEvent);
}
delay(100);
/* TODO: Drop delay, WFE+timer interrupt(s) ? */
delay(25);
}
}