enjoyneering / DFPlayer

Small and fast Arduino library for DFPlayer Mini MP3 Player
GNU General Public License v3.0
40 stars 9 forks source link
arduino arduino-library dfplayer dfplayer-mini dfplayer-mini-mp3 dfplayermini dfplayerminifast dfrobot dfrobot-dfplayer-mini gd3200b mp3 yx5200

license-badge ![version] stars ![hit-count] github-issues

DFPlayer Mini

This is small and fast Arduino library for:

alt text

DFPlayer Mini features:

NOTE:

Library APIs supports all modules features:

void begin(Stream& stream, uint16_t threshold = 350, DFPLAYER_MODULE_TYPE = DFPLAYER_MINI, bool feedback = false, bool bootDelay = true);

void setModel(DFPLAYER_MODULE_TYPE = DFPLAYER_MINI);
void setTimeout(uint16_t threshold); //usually 200msec..300msec for YX5200/AAxxxx chip & 350msec..500msec for GD3200B/MH2024K chip
void setFeedback(bool enable);

void setSource(uint8_t source); //all sources may not be supported by some modules
void playTrack(uint16_t track);
void next();
void previous();
void pause();
void resume();
void stop();

void playFolder(uint8_t folder, uint8_t track);
void playMP3Folder(uint16_t track);
void play3000Folder(uint16_t track); //may not be supported by some modules
void playAdvertFolder(uint16_t track);
void playAdvertFolder(uint8_t folder, uint8_t track); //may not be supported by some modules
void stopAdvertFolder();

void setVolume(uint8_t volume);
void volumeUp();
void volumeDown();
void enableDAC(bool enable); //flase=mute/true=unmute
void setDACGain(uint8_t gain, bool enable = true); //may not be supported by some modules
void setEQ(uint8_t preset); //may not be supported by some modules

void repeatTrack(uint16_t track);
void repeatCurrentTrack(bool enable);
void repeatAll(bool enable);
void repeatFolder(uint16_t folder);
void randomAll();

void sleep();
void wakeup(uint8_t source = 2);
void enableStandby(bool enable, uint8_t source = 2);
void reset();

uint8_t  getStatus();
uint8_t  getVolume();
uint8_t  getEQ(); //may not be supported by some modules
uint8_t  getPlayMode(); //may not be supported by some modules
uint8_t  getVersion();
uint16_t getTotalTracksSD();
uint16_t getTotalTracksUSB();
uint16_t getTotalTracksNORFlash(); //may not be supported by some modules
uint16_t getTrackSD();
uint16_t getTrackUSB();
uint16_t getTrackNORFlash(); //may not be supported by some modules
uint8_t  getTotalTracksFolder(uint8_t folder);
uint8_t  getTotalFolders(); //may not be supported by some modules
uint8_t  getCommandStatus();

Supports: