Do RFID scans only at specified intervals. System sounds are now supported, as well as more sound formats (.ogg, .mp4...).
This commit is contained in:
@ -13,7 +13,11 @@ Controller::Controller(Player* p) {
|
||||
}
|
||||
|
||||
void Controller::loop() {
|
||||
_check_rfid();
|
||||
unsigned long now = millis();
|
||||
if ((_last_rfid_scan_at < now - RFID_SCAN_INTERVAL) || (now < _last_rfid_scan_at)) {
|
||||
_check_rfid();
|
||||
_last_rfid_scan_at = now;
|
||||
}
|
||||
_check_serial();
|
||||
}
|
||||
|
||||
@ -44,6 +48,8 @@ void Controller::_check_serial() {
|
||||
_player->vol_down();
|
||||
} else if (c==' ') {
|
||||
_player->play_album("12345678");
|
||||
} else if (c=='q') {
|
||||
_player->play_system_sound("12345678/Biene Maja.mp3");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user