28574| 12
|
[项目] 红外遥控播放器-播放你的音乐(DFPlayer) |
上次一直想做一个音乐播放器,但是不知道何原因一直没能成功,于是在网上找资料,在其他论坛找到一个教程自己来做做看,这个作品是基于DFPlayer和uno板子来做的。大家会问DFPlayer是什么? DFPlayer Mini 是一款小巧且价格低廉的MP3模块,可以直接接驳扬声器。模块配合供电电池、扬声器、按键可以单独使用,也可以通过串口控制,作为Arduino UNO或者是任何有串口的单片机的一个模块。模块本身完美的集成了MP3、WAV、WMA的硬解码。同时软件支持TF卡驱动,支持FAT16、FAT32文件系统。通过简单的串口指令即可完成播放指定的音乐,以及如何播放音乐等功能,无需繁琐的底层操作,使用方便,稳定可靠。 更详尽的文档 可以参考产品资料库找更专业的资料 器材准备: DFRduino UNO R3IR kit红外遥控套 DFPlayer Mini 播放器模块 杜邦线、电阻等等 官方声明:此模块可以直接使用Arduino供电,并不会对Arduino本身造成任何影响。 如果使用Arduino供电,切记需要在串口通信端口上增加两个1K电阻用来消除噪音! 以下是搭建好的电路:
一切顺利,你就会得到一个可以用红外遥控器控制的音乐播放器。 * 以下是使用 DFPlayer Mini Module 的注意事項,请仔细阅读! *DFPlayer Mini 可以读取 MP3 & WAV 格式的文件(实测可以解码320K的超高品质音乐),但无法播放时长在1秒以下的音频。 *所有音乐文件一定要放在mp3文件夹内,而mp3文件命名需要是4位数字,例如"0001.mp3",放置在mp3文件夹下。如需中英文命名,可以添加在数字后。例如"0001hello.mp3"或者"0001后来.mp3",详见数据手册。 代码中使用的DFPlayer mini库文件已修改,增加了全曲循环功能。 以下是修改后的库文件: file:///c:/users/admin/appdata/roaming/360se6/User Data/temp/222616u3de8kfrdu1ge0gt.png file:///c:/users/admin/appdata/roaming/360se6/User Data/temp/222616u3de8kfrdu1ge0gt.png |
12.29 KB, 阅读权限: 10, 下载次数: 327
Cain 发表于 2015-11-10 16:31 我下载了库文件 错误代码这个 要怎么解决啊?谢谢 Arduino:1.6.5 (Mac OS X), 板:"Arduino/Genuino Uno" In file included from sketch_dec14d.ino:3:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:45:20: error: redefinition of 'uint8_t send_buf [10]' uint8_t send_buf[10] = { ^ In file included from sketch_dec14d.ino:1:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:45:9: error: 'uint8_t send_buf [10]' previously defined here uint8_t send_buf[10] = { ^ In file included from sketch_dec14d.ino:3:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:47:20: error: redefinition of 'uint8_t recv_buf [10]' uint8_t recv_buf[10]; ^ In file included from sketch_dec14d.ino:1:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:47:9: error: 'uint8_t recv_buf [10]' previously declared here uint8_t recv_buf[10]; ^ In file included from sketch_dec14d.ino:7:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:45:20: error: redefinition of 'uint8_t send_buf [10]' uint8_t send_buf[10] = { ^ In file included from sketch_dec14d.ino:1:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:45:9: error: 'uint8_t send_buf [10]' previously defined here uint8_t send_buf[10] = { ^ In file included from sketch_dec14d.ino:7:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:47:20: error: redefinition of 'uint8_t recv_buf [10]' uint8_t recv_buf[10]; ^ In file included from sketch_dec14d.ino:1:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:47:9: error: 'uint8_t recv_buf [10]' previously declared here uint8_t recv_buf[10]; ^ 编译有误。 |
Cain 发表于 2015-11-10 16:31 我下载了库文件 错误代码这个 要怎么解决啊?谢谢 Arduino:1.6.5 (Mac OS X), 板:"Arduino/Genuino Uno" In file included from sketch_dec14d.ino:3:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:45:20: error: redefinition of 'uint8_t send_buf [10]' uint8_t send_buf[10] = { ^ In file included from sketch_dec14d.ino:1:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:45:9: error: 'uint8_t send_buf [10]' previously defined here uint8_t send_buf[10] = { ^ In file included from sketch_dec14d.ino:3:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:47:20: error: redefinition of 'uint8_t recv_buf [10]' uint8_t recv_buf[10]; ^ In file included from sketch_dec14d.ino:1:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:47:9: error: 'uint8_t recv_buf [10]' previously declared here uint8_t recv_buf[10]; ^ In file included from sketch_dec14d.ino:7:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:45:20: error: redefinition of 'uint8_t send_buf [10]' uint8_t send_buf[10] = { ^ In file included from sketch_dec14d.ino:1:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:45:9: error: 'uint8_t send_buf [10]' previously defined here uint8_t send_buf[10] = { ^ In file included from sketch_dec14d.ino:7:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:47:20: error: redefinition of 'uint8_t recv_buf [10]' uint8_t recv_buf[10]; ^ In file included from sketch_dec14d.ino:1:0: /Documents/Arduino/libraries/DFPlayer-Mini-mp3-master/DFPlayer_Mini_Mp3.h:47:9: error: 'uint8_t recv_buf [10]' previously declared here uint8_t recv_buf[10]; ^ 编译有误。 |
© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed