Using A DFplayer MP3 player with a Picaxe 08M2

Описание к видео Using A DFplayer MP3 player with a Picaxe 08M2

Using a Picaxe micro-controller to play files on a DFplayer Mp3 player module. It shows how to play a file with a minimum amount of code. Then develop that into something more useful. I didn't realize the audio on the webcam was clipping. Sorry.

Datasheet:
https://github.com/DFRobot/DFRobotDFP...

Code:

#Picaxe 08M2
#no_data

symbol TX = C.2
symbol BUSY_PIN = pinC.1

symbol cmd = b3 'command to send to dfplayer like set volume or play file
symbol arg = b2 ' argument like volume level or file to play

setFreq M8 'has to be at least 8 Mhz so we can do 9600 baud
high TX ' the transmit line is high when nothing is being transmitted
pause 5000 ' wait for the dfplayer to initialize

cmd =$06 ' set volume
arg = 25 ' volume level
gosub sendCmd

main:

for arg = 1 to 10 'file number to play
cmd = $12 ' play file in MP3 folder
gosub sendCmd
next

pause 2000

goto main
'---------------subroutines-----------------
sendCmd:
serOut TX, T9600_8, ( $7E, $FF, $06,cmd, $00, 0,arg, $EF ) ' send
pause 200 'give dfplayer time to set busy pin
do while BUSY_PIN = 0
pause 100
loop

return

Комментарии

Информация по комментариям в разработке