Directly start a song from list
This commit is contained in:
@@ -5,6 +5,8 @@ void stop();
|
||||
|
||||
void start();
|
||||
|
||||
bool playFile(const char* filename, uint32_t resumeFilePos = 0);
|
||||
|
||||
void loop2(void* parameter);
|
||||
|
||||
void named_song_action(AsyncWebServerRequest *request);
|
||||
@@ -30,6 +32,22 @@ String getRFIDString(byte uidByte[10])
|
||||
return uidString;
|
||||
}
|
||||
|
||||
void writeFile(fs::FS &fs, const char * path, const char * message){
|
||||
Serial.printf("Writing file: %s\n", path);
|
||||
|
||||
File file = fs.open(path, FILE_WRITE);
|
||||
if(!file){
|
||||
Serial.println("Failed to open file for writing");
|
||||
return;
|
||||
}
|
||||
if(file.print(message)){
|
||||
Serial.println("File written");
|
||||
} else {
|
||||
Serial.println("Write failed");
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
|
||||
unsigned long lastStart = 0;
|
||||
|
||||
const int startDelay = 250;
|
||||
|
||||
Reference in New Issue
Block a user