Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A micropython driver for the DFPlayer Mini, intended as a low-level alternative including device status and feedback processing.

License

Notifications You must be signed in to change notification settings

tomdionysus/dfplayermini-micropython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DFPlayerMini micropython Driver

A python driver for the DFPlayer Mini in serial (UART) mode, intended as a low-level alternative driver including device status and feedback processing.

The driver is based directly on the Official DFPlayer C/C++ driver and best-fit supports the same interface.

Getting Started

Import and instantiate the driver as follows:

from dfplayer_mini import DFPlayerMini

player = DFPlayerMini(tx_pin=1, rx_pin=2)

player.begin()
player.play_track(1)

Methods

Initialisation

  • begin()

Basic Commands

  • play_track(track_number)
  • play_next()
  • play_previous()
  • set_volume(volume)
  • volume_up()
  • volume_down()
  • pause()
  • resume()
  • stop()

Status & Feedback Commands

  • get_status()
  • poll_feedback()

Advanced Commands

  • repeat_track(track_number)
  • play_from_folder(folder_number, track_number)
  • shuffle_play()

Utility Commands

  • reset()
  • sleep()
  • wake_up()
  • set_playback_source(source)
  • set_equalizer(eq_mode)
  • set_volume_adjustment(gain)
  • repeat_play(enable)

Low-Level Commands

  • wait_for_ready()
  • send_command(command, parameter=0)
  • calculate_checksum(command, param_high, param_low)

Constants

DFPlayerMini includes all relevant constants (commands, statuses, etc). Please see the source code for details.

Tests

Please see test_dfplayer_mini.py for tests (unittest).

License

DFPlayerMini is licensed under the MIT License. See LICENSE for details.

References

About

A micropython driver for the DFPlayer Mini, intended as a low-level alternative including device status and feedback processing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages