# card_music **Repository Path**: wangqiyuejava63/card_music ## Basic Information - **Project Name**: card_music - **Description**: 卡片音乐播放器 仅做备份,侵删 视频教程来自: https://www.bilibili.com/video/BV1ww411B7s4 相关的材料和程序下载地址: 链接: https://pan.baidu.com/s/1KiURPVqTlq_J8uNejUtsEQ?pwd=3939 提取码: 3939 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-14 - **Last Updated**: 2025-04-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # arduino NFC识别音乐播放项目 ## 材料准备 ### 1. arduino uno 3 (其他的arduino应该也行) ### 2. DFPlayer mini mp3 模块 需要带排针的,否则需要自己焊 ![dfplayer mini](dfplayer_mini模块.jpg) ### 3. 喇叭 不得超过3W,这个可能要自己焊了。 ### 4. tf卡 不超过32GB,格式化为 FAT32 或者 NTFS 格式 在根目录下创建一个名为 `mp3` 的目录(不区分大小写) `mp3`目录内,存放若干首歌曲,歌曲必须有4位数前缀。 例如: **0002_贝加尔湖_李健.mp3** ### 5. 杜邦线若干 一般是公对母,公头接 arduino 的排母 母头接 dfplayer mini mp3 模块的排针 ## 连接 ![alt text](image.png) | dfplayer mini | Arduino | | -- | -- | | 5V | 5V| | GND|GND| | RX| D8| |TX | D7| dfplayer mini的 SP1 SP2 接喇叭(不分正负) | MFRC522 | Arduino | | -- | -- | | 3.3V | 3.3V| | RST | D9| | GND | GND| | IRQ | 置空 | | MISO| D12| | MOSI | D11| | SCK | D13| | SCA | D10| ## 使用步骤 ### 1. TF卡存储音乐 TF卡内,需要在根目录下创建一个叫 `mp3` 的文件夹,不区分大小写 在 `mp3` 文件夹内,存储前缀名为 0001 到 9999 的歌曲 例如 `0001_晴天_周杰伦.mp3` ### 2. 歌曲信息写入NFC贴片 参考另一个项目: [NFCWriter] https://gitee.com/wangqiyuejava63/nfcwriter 将歌曲信息存储到NFC贴片内 ### 3. 将程序写入 arduino 注意,程序编译可能会报错: > Compilation error: DFRobotDFPlayerMini.h: no such file or directory > Compilation error: MFRC522.h : no such file or directory 这都可以通过 **库管理** 来解决 如图: ![库管理](库管理.png) ### 4. 播放音乐 刷对应的NFC卡即可播放对应的歌曲 任何时候刷,都可以的。 目前一曲播放完就结束,无法暂停或者重复。