Go Down

Topic: New and Improved DFPlayer Mini Library!! (Read 28402 times) previous topic - next topic

Power_Broker

Also, if you get a -1 response from a query, it means the DFplayer timed-out. Otherwise, the response is what the DFplayer reported (response type varies with query - obviously)
"The desire that guides me in all I do is the desire to harness the forces of nature to the service of mankind."
   - Nikola Tesla

nokiandrea

Hi, i want check current volume level.
I use currentVolume function into void Loop section for printing volume value but playng is slowly. Anyone have the same problem?

nokiandrea

Another question, i use isPlaying function for "pause and resume" with one button.
When i click button for pause, i not have a fast response, resume function it's ok.
If i connect arduino in usb port and i open serial monitor for checking "isPlayng status" i had 0 and 1 result in alternate mode.

Power_Broker

Hi, i want check current volume level.
I use currentVolume function into void Loop section for printing volume value but playng is slowly. Anyone have the same problem?
Please post the following:

- Your entire sketch
- Full wiring schematic (an additional set of pictures of your wiring is also a plus)
- File contents (including file paths) of your SD card

Did you read the library's readme and DFPlayer Wiki?
"The desire that guides me in all I do is the desire to harness the forces of nature to the service of mankind."
   - Nikola Tesla

jesse59672

I'm transitioning over to this DFplayer library and I have a quick question. How do you stop playing a track? .stop doesn't appear to be supported and I didn't see anything similar on GitHub.

Code: [Select]
exit status 1
'class DFPlayerMini_Fast' has no member named 'stop'; did you mean 'loop'?

Power_Broker

#50
Mar 31, 2020, 06:08 am Last Edit: Mar 31, 2020, 06:09 am by Power_Broker
The library's readme on the repo page shows the entire API listing. Here it is for quick reference:

Quote
bool begin(Stream& stream);

void playNext();
void playPrevious();
void play(uint16_t trackNum);
void playFromMP3Folder(uint16_t trackNum);
void playAdvertisement(uint16_t trackNum);
void incVolume();
void decVolume();
void volume(uint8_t volume);
void EQSelect(uint8_t setting);
void loop(uint16_t trackNum);
void playbackSource(uint8_t source);
void standbyMode();
void normalMode();
void reset();
void resume();
void pause();
void playFolder(uint8_t folderNum, uint8_t trackNum);
void volumeAdjustSet(uint8_t gain);
void startRepeatPlay();
void stopRepeatPlay();
void repeatFolder(uint16_t folder);
void randomAll();
void startRepeat();
void stopRepeat();
void startDAC();
void stopDAC();
void sleep();
void wakeUp();

bool isPlaying();
int16_t currentVolume();
int16_t currentEQ();
int16_t currentMode();
int16_t currentVersion();
int16_t numUsbTracks();
int16_t numSdTracks();
int16_t numFlashTracks();
int16_t currentUsbTrack();
int16_t currentSdTrack();
int16_t currentFlashTrack();
int16_t numTracksInFolder(uint8_t folder);
int16_t numFolders();

void findChecksum(stack *_stack);
void sendData();
void flush();
int16_t query(uint8_t cmd, uint8_t msb=0, uint8_t lsb=0);
bool getStatus(uint8_t cmd);
bool parseFeedback();
bool timeout();

void printStack(stack _stack);
To answer your question, you can use 'pause()'.
"The desire that guides me in all I do is the desire to harness the forces of nature to the service of mankind."
   - Nikola Tesla

jesse59672

***Update***

I did some work upgrading the library - now all DFPlayerMini commands and queries are supported by the library!

Sorry for the noob question, I read through the thread first and saw this and assumed .stop was included. I just figured that .pause was fundamentally different than .stop, but after thinking about it more it probably has the same result. Thanks for the response!

Go Up