I have a student project where I am making a Mp3player.
Also, I am using LED's which should be turned on and off depending on which song is playing.
Example: Red LED for song 003.mp3 , Blue LED for song 002.mp3, ......
I thought it is best to get the DFPlayer to tell me which song it is currently playing and accordingly turning on the LED.
like:
readCurrentFileNumber();
if currentFileNumber(1) ;
pinMode(led1, HIGH);
Now I can't figure out which Function to use that the Player tells me the number of the song. I am using the DFRobotDFplayerMini library and a Nano.
If anyone knows something, that would be super nice and help me a lot.
ah sorry didn't mentioned that. I also have start/pause and next button. So if next is pressed the next song will play but of course the LED won't switch. So I need something to tell the LED when to switch.
Other users more familiar with that MP3 player may chip in here and correct me if I'm wrong, but I seem to recall that when you instruct the chip to play track 3, it plays the 3rd track that was copied to the SD card, NOT a file called 003.mp3.
I don't recall the facility to discover the actual filename of the mp3 track that is playing.
You can use one of the FAT file sorting programs to rearrange the file list stored in the FAT so that they are in numerical order, and assuming no gaps, that playing track 4 would effectively cause the file 004.mp3 to play.
You would effectively know which song was being played as you would have requested the song number in the function call.
I seem to recall a user on here @Terrypin who was quite knowledgeable about this particular player. They may respond with more details for you.