{"id":13613148,"url":"https://github.com/ShrimpingIt/micropython-dfplayer","last_synced_at":"2025-04-13T15:32:36.913Z","repository":{"id":65939358,"uuid":"96523935","full_name":"ShrimpingIt/micropython-dfplayer","owner":"ShrimpingIt","description":"Micropython implementation of DFPlayer control using UART 1 (secondary Serial connection)","archived":false,"fork":false,"pushed_at":"2020-05-17T16:27:56.000Z","size":115,"stargazers_count":41,"open_issues_count":0,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-02T20:45:08.566Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ShrimpingIt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-07T09:40:24.000Z","updated_at":"2024-04-04T08:39:10.000Z","dependencies_parsed_at":"2023-02-17T09:25:13.912Z","dependency_job_id":null,"html_url":"https://github.com/ShrimpingIt/micropython-dfplayer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShrimpingIt%2Fmicropython-dfplayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShrimpingIt%2Fmicropython-dfplayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShrimpingIt%2Fmicropython-dfplayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShrimpingIt%2Fmicropython-dfplayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShrimpingIt","download_url":"https://codeload.github.com/ShrimpingIt/micropython-dfplayer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223592497,"owners_count":17170499,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T20:00:40.687Z","updated_at":"2024-11-07T21:30:45.817Z","avatar_url":"https://github.com/ShrimpingIt.png","language":"Python","readme":"# micropython-dfplayer\n\nMicropython implementation of DFPlayer control using UART 1 (secondary Serial connection) on ESP8266\n\nIf you are not limited to ESP8266 (with its TX-only UART) you should consider using https://github.com/jczic/KT403A-MP3/blob/master/kt403A.py instead.\n\nTo use, wire up the DFPlayer Mini MP3 breakout module following this loom...\n\n![alt text](550px-Miniplayer_pin_map.png)\n\n* DFPlayer Mini\n    * VCC           =\u003e 5V Vin\n    * All GND pins  =\u003e GND\n    * Busy Pin (immediately opposite VCC) =\u003e GPIO2 (NodeMCU D3)\n    * RX Pin (immediately below VCC)      =\u003e GPIO0 (NodeMCU D4)\n    * SPK1+SPK2 to a 3W speaker (limiting the volume to 0.5 can help prevent brownout for larger wattage speakers)\n    * ...or...\n    * DAC_R+DAC_L to a 3.5mm Line Out Jack\n\nThe following example code uses the ScanPlayer. \n\nIt will first scan all available folders for files called 000_XXX.mp3 001_XXX.mp3 and so on.\n\nIt considers only folders named 00-09.\n\nIt will play a single track from each folder in turn, only repeating a folder \nwhen all folders are exhausted, and only repeating a track when all tracks have been exhausted. \n\n```python\nfrom time import sleep\nimport scanplayer\nplayer = scanplayer.ScanPlayer()\navailableFolders = list(player.tracks.keys())\nif len(availableFolders) \u003e 0:\n    keyPos = 0\n    while True:\n        folder = availableFolders[keyPos]\n        player.playFolder(folder)\n        while player.playing():\n            sleep(0.1)\n        keyPos = (keyPos + 1) %  len(availableFolders)\nelse:\n    print(\"No available tracks\")\n```\n\n\n","funding_links":[],"categories":["精选驱动库","Libraries"],"sub_categories":["输出类","Audio"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FShrimpingIt%2Fmicropython-dfplayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FShrimpingIt%2Fmicropython-dfplayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FShrimpingIt%2Fmicropython-dfplayer/lists"}