Added initial Melody Playback Ability

Now, controlled via MQTT a Playback of a melody can Start, Stop, Pause 
etc. 

Settings like speed, total duration, pauses etc can be set.
This commit is contained in:
2025-01-19 21:15:07 +02:00
parent 2cbbc8d591
commit a33f626dde
36 changed files with 4263 additions and 236 deletions

28
build/sketch/Timers.hpp Normal file
View File

@@ -0,0 +1,28 @@
#line 1 "C:\\Users\\espi_\\Documents\\Arduino\\vesper\\Timers.hpp"
#pragma once
extern volatile uint64_t startTime;
extern melody_attributes melody;
extern volatile bool playing;
void durationTimer(void *param);
void durationTimer(void *param){
// SETUP TASK
for (;;){
if (playing){
uint64_t now = millis();
uint64_t timeToStop = startTime + melody.duration;
if (now > timeToStop) {
playing = false;
Serial.println("Time Limit Reached. Stopping !");
}
}
}
}