mirror of
https://github.com/sweidac/kidsbox.git
synced 2025-07-28 03:41:54 +02:00
Play a configured file when rfid-tag is placed on the reader.
This commit is contained in:
@@ -4,6 +4,9 @@
|
||||
#include "WebInterface.hpp"
|
||||
#include "RFIDInterface.hpp"
|
||||
#include "AudioPlayer.hpp"
|
||||
#include "TagPlayerControl.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
extern "C" {
|
||||
void app_main();
|
||||
@@ -16,14 +19,21 @@ RFIDInterface rfid;
|
||||
void app_main(void) {
|
||||
initArduino();
|
||||
|
||||
networking.connectWifi();
|
||||
webInterface.initSD();
|
||||
|
||||
/* networking.connectWifi();
|
||||
webInterface.start();
|
||||
|
||||
rfid.registerWebResources(&webInterface);
|
||||
webInterface.finishResourceRegistrations();
|
||||
|
||||
*/
|
||||
AudioPlayer audioPlayer; // initialize here, because the ctor does init stuff that fails when executed before `app_main()`
|
||||
audioPlayer.play("file://sdcard/howcanwehangontoadream.mp3");
|
||||
|
||||
rfid.start();
|
||||
|
||||
TagPlayerControl tagPlayerControl(&audioPlayer);
|
||||
|
||||
rfid.registerTagChangeCallback([&tagPlayerControl](char* tagId) {
|
||||
tagPlayerControl.onTagChanged(tagId);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user