Difference between revisions of "Component: DFPlayer (MP3 / WAV) (Audio Output)"
From Flowcode Help
Jump to navigationJump to search| Line 15: | Line 15: | ||
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.    | 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   | + | ==Component Source Code==  | 
| − | + | Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_DFPlayer.fcfx FC_Comp_Source_DFPlayer.fcfx]  | |
==Detailed description==  | ==Detailed description==  | ||
| + | |||
| + | |||
| Line 34: | Line 36: | ||
==Examples==  | ==Examples==  | ||
| + | |||
| + | |||
| Line 262: | Line 266: | ||
|-  | |-  | ||
|-  | |-  | ||
| − | | width="10%" align="center" style="background-color:#  | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]  | 
| − | | width="90%" style="background-color:#  | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections  | 
|-  | |-  | ||
|-  | |-  | ||
| Line 296: | Line 300: | ||
| colspan="2" | Controls if we are monitoring the busy pin or not. Used by the IfBusy component macro.   | | colspan="2" | Controls if we are monitoring the busy pin or not. Used by the IfBusy component macro.   | ||
|-  | |-  | ||
| − | | width="10%" align="center" style="background-color:#  | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]  | 
| − | | width="90%" style="background-color:#  | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation  | 
|-  | |-  | ||
|-  | |-  | ||
Revision as of 17:45, 9 November 2022
| Author | 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 for the component source code: FC_Comp_Source_DFPlayer.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No Examples here yet
Downloadable macro reference
| PausePlayResetStop | |
| Allows the current playing track to be paused, restarted or reset | |
| Mode | |
| 0=Pause, 1=Play, 2=Reset, 3=Stop | |
| Return | |
| SendCommand | |
| Sends a command to the DFPlayer module | |
| Command | |
| Command code byte | |
| Feedback | |
| Collect feedback byte: Range 0-1 | |
| Parameter | |
| 16-bit Parameter | |
| Return | |
| 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. | |
| Return | |
| SetVolume | |
| Sets the volume level for the module | |
| Volume | |
| Range: 0 (min) - 30 (max) | |
| Return | |
| SetEQ | |
| Sets the equaliser mode for the module | |
| EQMode | |
| Range: 0-5 0=Normal, 1=Pop, 2=Rock, 3=Jazz, 4=Classic, 5=Bass | |
| Return | |
| IsPlaying | |
| Checks to see if the last played track is still playing | |
| Return | |
| GetReplyByte | |
| Reads a single byte from the last reply. Each reply contains 4 bytes starting with the command code. | |
| Index | |
| Range: 0-3 / 0=Command, 1=Feedback, 2=Data MSB, 3=Data LSB | |
| Return | |
| SkipTrack | |
| Jump to the next or previous track | |
| Direction | |
| 0=Next, 1=Previous | |
| Return | |
| Initialise | |
| Sets up the UART and does some housekeeping. Must be called before calling any of the other component macros. | |
| Return | |