Closed ejmorgan55 closed 3 years ago
you do begin Serial twice. no Serial1
I eliminated Serial 1; albeit, I use it in the longer program. Eliminating serial1 did not help. I still cannot get it to play any folder. It will play random; all, or individual MP3s; however, it will not play any folder request? Any troubleshooting I can do?
The following sketch works for me on a Mega:
#include <DFPlayerMini_Fast.h>
DFPlayerMini_Fast myMP3;
void setup()
{
Serial.begin(115200);
Serial1.begin(9600);
myMP3.begin(Serial1);
myMP3.volume(20);
delay(20);
myMP3.playFolder(1,2);
}
void loop()
{
}
If you need SoftwareSerial, it shouldn't be too hard to replace Serial1 manually.
Thanks; however, this script does not compile on a Nano?
Serial exit status 1 'Serial1' was not declared in this scope
If I remove serial1, it will compile; however, it will not playFolder. I do appreciate the help though.
If you need SoftwareSerial, it shouldn't be too hard to replace Serial1 manually.
#include <DFPlayerMini_Fast.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
DFPlayerMini_Fast myMP3;
void setup()
{
Serial.begin(115200);
mySerial.begin(9600);
myMP3.begin(mySerial);
myMP3.volume(20);
delay(20);
myMP3.playFolder(1,2);
}
void loop()
{
}
Also, make sure to follow the filename rules as specified in the readme:
If the files are played from folders other than root or "mp3", the folder names must be zero-padded 2-digit numbers while their contents must be audio files with names prepended by a zero-padded 3-digit number.
Thanks; I had removed the serial1 as in the program above; however, as stated, the dfplayer does not playFolder. If I replace playFolder with, for example, randomAll, it plays fine. I have checked the mp3 protocol several times. I have an folder in root named mp3; in the mp3 folder, I have 3 folders named 01,02,03. In each folder, I have mp3 files named 0001, 0002, 0003, etc; should work. I have used the dfplayer in the past with an arduino nano without problems constructing a music box. Not sure why I cannot get the playFolder to work on this one. It seems unlikely; however, I wonder if it is a problem with the dfplayer chip? Regardless, thanks for taking time to help. If you have other suggestions, please let me know.
OK; so I pulled the folders out of the folder named mp3; and simply pasted them into the root directory as 01,02,03, and it now works? Not sure why they will not play via the mp3 folder directory, unless I have been misreading the data sheet for the dfplayer?
I have 3 folders named 01,02,03. In each folder, I have mp3 files named 0001, 0002, 0003, etc; should work.
No, if you look at the readme excerpt, each mp3 needs a 3 digit, zero-filled number. The function does work if the file structure and code is setup properly
playFolder function is not working. All other functions such as playRandom work. I have 3 folders on the SD (01, 02, 03) and 112 MP3s in each folder (0001 to 0112). Fat 32 file, all formatted correctly IAW DFplayer instructions. Am I mission something? I simplified the code for inclusion below: