Component: DFPlayer (MP3 / WAV) (Audio Output)
From Flowcode Help
(Redirected from Component: ID 2061d38d 0cca 440c a842 f9c84ca55f90)
Jump to navigationJump to searchAuthor | Matrix TSL |
Version | 1.0 |
Category | Audio Output |
Contents
DFPlayer (MP3 / WAV) component
A small module capable of streaming MP3 and WAV audio files from a micro SD card. Controlled via a serial UART connection to the microcontroller.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_DFPlayer.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_DFPlayer.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No Examples here yet
Macro reference
GetError
GetReplyByte
GetReplyByte | |
Reads a single byte from the last reply. Each reply contains 4 bytes starting with the command code. | |
- BYTE | Index |
Range: 0-3 / 0=Command, 1=Feedback, 2=Data MSB, 3=Data LSB | |
- BYTE | Return |
Initialise
Initialise | |
Sets up the UART and does some housekeeping. Must be called before calling any of the other component macros. | |
- VOID | Return |
IsPlaying
IsPlaying | |
Checks to see if the last played track is still playing | |
- BOOL | Return |
IsReplyAvailable
IsReplyAvailable | |
Checks to see if new data has been received from the module. Returns true when new data is available. Collect the data using the GetReplyByte macro. | |
- BOOL | Return |
PausePlayResetStop
PausePlayResetStop | |
Allows the current playing track to be paused, restarted or reset | |
- UINT | Mode |
0=Pause, 1=Play, 2=Reset, 3=Stop | |
- VOID | Return |
PlayTrack
SendCommand
SendCommand | |
Sends a command to the DFPlayer module | |
- BYTE | Command |
Command code byte | |
- BOOL | Feedback |
Collect feedback byte: Range 0-1 | |
- UINT | Parameter |
16-bit Parameter | |
- VOID | Return |
SetEQ
SetEQ | |
Sets the equaliser mode for the module | |
- BYTE | EQMode |
Range: 0-5 0=Normal, 1=Pop, 2=Rock, 3=Jazz, 4=Classic, 5=Bass | |
- VOID | Return |
SetVolume
SetVolume | |
Sets the volume level for the module | |
- BYTE | Volume |
Range: 0 (min) - 30 (max) | |
- VOID | Return |
SkipTrack
SkipTrack | |
Jump to the next or previous track | |
- BOOL | Direction |
0=Next, 1=Previous | |
- VOID | Return |
WhilePlaying