Difference between revisions of "Component: DFPlayer (MP3 / WAV) (Audio Output)"
From Flowcode Help
Jump to navigationJump to search| Line 68: | Line 68: | ||
No Examples here yet  | No Examples here yet  | ||
| + | |||
| + | |||
| Line 73: | Line 75: | ||
==Macro reference==  | ==Macro reference==  | ||
| + | ===PausePlayResetStop===  | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | ||
|-  | |-  | ||
| Line 91: | Line 94: | ||
| + | ===SendCommand===  | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | ||
|-  | |-  | ||
| Line 119: | Line 123: | ||
| + | ===IsReplyAvailable===  | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | ||
|-  | |-  | ||
| Line 132: | Line 137: | ||
| + | ===SetVolume===  | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | ||
|-  | |-  | ||
| Line 150: | Line 156: | ||
| + | ===SetEQ===  | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | ||
|-  | |-  | ||
| Line 168: | Line 175: | ||
| + | ===GetError===  | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | ||
|-  | |-  | ||
| Line 181: | Line 189: | ||
| + | ===WhilePlaying===  | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | ||
|-  | |-  | ||
| Line 199: | Line 208: | ||
| + | ===IsPlaying===  | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | ||
|-  | |-  | ||
| Line 212: | Line 222: | ||
| + | ===GetReplyByte===  | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | ||
|-  | |-  | ||
| Line 230: | Line 241: | ||
| + | ===SkipTrack===  | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | ||
|-  | |-  | ||
| Line 248: | Line 260: | ||
| + | ===PlayTrack===  | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | ||
|-  | |-  | ||
| Line 271: | Line 284: | ||
| + | ===Initialise===  | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"  | ||
|-  | |-  | ||
Revision as of 11:49, 3 February 2023
| 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 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
PausePlayResetStop
| PausePlayResetStop | |
| Allows the current playing track to be paused, restarted or reset | |
| Mode | |
| 0=Pause, 1=Play, 2=Reset, 3=Stop | |
| Return | |
SendCommand
| 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
| 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
| SetVolume | |
| Sets the volume level for the module | |
| Volume | |
| Range: 0 (min) - 30 (max) | |
| Return | |
SetEQ
| 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 | |
GetError
WhilePlaying
IsPlaying
| IsPlaying | |
| Checks to see if the last played track is still playing | |
| Return | |
GetReplyByte
| 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
| SkipTrack | |
| Jump to the next or previous track | |
| Direction | |
| 0=Next, 1=Previous | |
| Return | |
PlayTrack
Initialise
| Initialise | |
| Sets up the UART and does some housekeeping. Must be called before calling any of the other component macros. | |
| Return | |