why it needs to include mp3_next () command to play 1 file ex: 0001.mp3 from all files saved in the SDcard in a given instance?
And why the code plays the next files after each power reset?
My goal is to play 0001.mp3 at a given time. Then 0003.mp3 on another instance. I don't want to play them all at once. I just want to select a file which I like via coding (no using of trigger button)
Can somebody correct the code below?
#include <SoftwareSerial.h>
#include <DFPlayer_Mini_Mp3.h>
int N = 1;
int runXTimes = 0;
void setup ()
{
Serial.begin (9600);
mp3_set_serial (Serial); //set Serial for DFPlayer-mini mp3 module
mp3_set_volume (10);
}
void loop()
{
if (runXTimes < N)
{
mp3_play (1);
mp3_next ();
delay (2000);
runXTimes++;
}
}
//and on another instance play 0007.mp3
void loop() // By the way what word should I put as replace,ent for the 2nd void loop?
{
if (runXTimes < N)
{
mp3_play (7);
mp3_next ();
delay (2000);
runXTimes++;
}
}
why it needs to include mp3_next () command to play 1 file ex: 0001.mp3 from all files saved in the SDcard in a given instance?
Does it need that command? I don't have that module but the documentation (it was your duty to provide that link!) says that the mp3_play(nr) should be sufficient to play that file.
And why the code plays the next files after each power reset?
What's a power reset? A power cycle? Or do you use more power to push the reset button?
I guess you should ask these questions the manufacturer of the module. They know what they programmed into their module. The source code of the firmware is not opened and the documentation is quite sparse.