FN-M16P Embedded MP3 Audio Module using DFRobotDFPlayerMini.h" include file.
![userHead](https://dfimg.dfrobot.com/dfPortrait2.png)
Hello Forum,
I have built a mini MP3 player using an “Arduino Nano” with an “FN-M16P Embedded MP3 Audio Module”. The program that drives the player uses "DFRobotDFPlayerMini.h" include file. The player is intended to play two different MP3 music files. Each file is intended to play based on two separate inputs to the Nano. I would like to stop the first file from playing when a second input is received and play the second file. I have looked at the source for the "DFRobotDFPlayerMini.h" and see there is a “Stop” function. My question to you is: Is the Stop function implemented in the “dot h” file? If it is, what is the syntax for the instruction? Are there any declarations that need to be made along with other data declarations? If the “Stop” function is not implemented, would you be able to do so to modify the “dot h” file? I will be grateful for any assistance you can provide.
Hi,
The 'Stop' function is declared in the '.h' file and implemented in the '.cpp' file.Implementation principle: This command will put '0x16' in the 'CMD' position in the data format, which means stop playing.This does not need to be done with other declarations, you could use 'myDFPlayer.stop();' directly in the Arduino IDE, and then it will work.
![](https://dfimg.dfrobot.com/64c9cfc3aa9508d63a4302bd/enshopforum/38e5e17ffc6d8f1867752117e87953d2.png)
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)