Skip to content

Circuitpython implementation of DFPlayer control using UART 1 (secondary Serial connection)

License

Notifications You must be signed in to change notification settings

house4hack/micropython-dfplayer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

circuitpython-dfplayer

Micropython implementation of DFPlayer from (PLdeSousa/micropython-dfplayer) ported to CircuitPython (4.1)

Only dfplayer.py was ported

alt text

  • DFPlayer Mini => e.g. Adafruit ItsyBitsy M4
    • VCC => 3.3V
    • All GND pins => GND
    • Busy Pin => A5
    • RX Pin => A2
    • TX Pin => A3
    • SPK1+SPK2 to a 3W speaker (limiting the volume to 0.5 can help prevent brownout for larger wattage speakers)
    • ...or...
    • DAC_R+DAC_L to a 3.5mm Line Out Jack

Songs are organized in folders named: 1,2,3 etc. Songs within a folder similarly: 1.mp3, 2.mp3 etc.

Example usage:

   import board
   import dfplayer
   import time
   
   busy_pin = digitalio.DigitalInOut(board.A5)
   player_uart = busio.UART(board.A2, board.A3, baudrate=9600)
   player = dfplayer.Player(busy_pin=busy_pin, uart=player_uart)
   print("Folder count", player.query_folders())
   print("Songs in folder 1", player.query_filesInfolder(1))
   player.play(1,1)
   while player.playing():
       time.sleep(0.5)

About

Circuitpython implementation of DFPlayer control using UART 1 (secondary Serial connection)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%