智能仪表课程设计与制作.doc
《智能仪表课程设计与制作.doc》由会员分享,可在线阅读,更多相关《智能仪表课程设计与制作.doc(19页珍藏版)》请在沃文网上搜索。
1、智能仪表课程设计与制作实训项目之二简易WAVE音乐播放器一、设计要求用单片机设计并制作一个可以播放WAVE格式的音乐播放器。要求:1.在单片机内部内置4首WAVE格式音乐;2.用4个不同按键代表播放不同的音乐,当某个音乐播放的时候,按其他音乐按键没有任何效果;3.当音乐开始播放后,按停止按键可以终止当前的音乐播放;4.在音乐播放的同时,用8个LED灯表示音乐播放的音节。二、电路原理音节显示LED电路原理可参考图1-1。图1-1 音节显示LED原理图音乐播放部分电路图可以参考图1-2。图1-2 音乐播放部分电路参考原理图按键部分电路图可以参考图1-3。图1-3 按键部分电路参考原理图核心部分原理
2、图可以参考图1-4。图1-4 核心部分原理图电路也可自行设计。三、程序的设计1.misuc_code.h。WAVE音乐文件/*Music*uchar code song15=The Fairy Tale,Coral Sea,Meet,Love Transfer;/爱情呼叫转移uchar code Love= 0x0F,0x03, 0x10,0x03, 0x15,0x03, 0x16,0x03, 0x15,0x03, 0x16,0x03, 0x17,0x0D, 0x17,0x03, 0x17,0x0D, 0x17,0x03, 0x17,0x03, 0x16,0x03, 0x15,0x03, 0x
3、16,0x03, 0x17,0x0D, 0x17,0x03, 0x17,0x0D, 0x17,0x03, 0x17,0x03, 0x16,0x03, 0x15,0x03, 0x16,0x67, 0x15,0x0E, 0x15,0x03, 0x10,0x03, 0x15,0x67, 0x16,0x0E, 0x16,0x03, 0x17,0x03, 0x17,0x66, 0x0F,0x03, 0x10,0x03, 0x15,0x03, 0x16,0x03, 0x15,0x03, 0x16,0x03, 0x15,0x0D, 0x15,0x03, 0x19,0x03, 0x19,0x03, 0x17,
4、0x03, 0x16,0x03, 0x17,0x03, 0x16,0x03, 0x15,0x0D, 0x15,0x03, 0x17,0x0D, 0x17,0x03, 0x17,0x03, 0x16,0x03, 0x15,0x03, 0x16,0x67, 0x16,0x0E, 0x16,0x03, 0x16,0x03, 0x16,0x67, 0x15,0x0E, 0x15,0x03, 0x10,0x03, 0x16,0x66, 0x0F,0x03, 0x10,0x03, 0x15,0x03, 0x16,0x03, 0x15,0x03, 0x16,0x03, 0x17,0x0D, 0x17,0x0
5、3, 0x19,0x0D, 0x19,0x03, 0x17,0x03, 0x16,0x03, 0x15,0x03, 0x16,0x03, 0x17,0x0D, 0x17,0x03, 0x1A,0x0D, 0x1A,0x03, 0x17,0x03, 0x16,0x03, 0x15,0x03, 0x16,0x67, 0x15,0x0E, 0x15,0x03, 0x10,0x03, 0x15,0x67, 0x16,0x0E, 0x16,0x03, 0x17,0x03, 0x19,0x66, 0x0F,0x03, 0x10,0x03, 0x15,0x03, 0x16,0x03, 0x15,0x03,
6、0x16,0x03, 0x15,0x0D, 0x15,0x03, 0x1A,0x0D, 0x1A,0x03, 0x19,0x03, 0x17,0x03, 0x17,0x03, 0x16,0x03, 0x15,0x0D, 0x15,0x03, 0x17,0x0D, 0x17,0x03, 0x17,0x03, 0x16,0x03, 0x15,0x03, 0x16,0x67, 0x16,0x0E, 0x16,0x03, 0x16,0x03, 0x16,0x67, 0x15,0x0E, 0x15,0x03, 0x10,0x03, 0x15,0x66, 0x15,0x03, 0x1F,0x03, 0x1
7、B,0x03, 0x1F,0x03, 0x1A,0x03, 0x1F,0x67, 0x1A,0x0E, 0x1A,0x03, 0x19,0x03, 0x1A,0x03, 0x19,0x03, 0x17,0x03, 0x16,0x03, 0x17,0x03, 0x19,0x03, 0x1A,0x03, 0x19,0x0D, 0x19,0x03, 0x19,0x03, 0x1A,0x03, 0x19,0x03, 0x1A,0x67, 0x1A,0x0E, 0x1A,0x03, 0x1A,0x03, 0x1A,0x67, 0x19,0x0E, 0x19,0x03, 0x1A,0x03, 0x19,0
8、x03, 0x17,0x0D, 0x17,0x16, 0x15,0x03, 0x16,0x03, 0x17,0x03, 0x19,0x03, 0x17,0x03, 0x16,0x03, 0x15,0x0D, 0x15,0x03, 0x15,0x03, 0x16,0x03, 0x17,0x03, 0x1A,0x03, 0x17,0x03, 0x16,0x03, 0x15,0x0D, 0x15,0x03, 0x15,0x03, 0x15,0x03, 0x15,0x03, 0x1F,0x67, 0x1F,0x0E, 0x1F,0x03, 0x1F,0x03, 0x1F,0x67, 0x1A,0x0E
9、, 0x1A,0x03, 0x1F,0x03, 0x1A,0x66, 0x19,0x0D, 0x19,0x03, 0x15,0x03, 0x1F,0x03, 0x1B,0x03, 0x1F,0x03, 0x1B,0x03, 0x1A,0x03, 0x19,0x03, 0x1A,0x03, 0x19,0x03, 0x17,0x03, 0x16,0x03, 0x17,0x03, 0x19,0x03, 0x1A,0x03, 0x19,0x0D, 0x19,0x03, 0x19,0x03, 0x1A,0x03, 0x19,0x03, 0x1A,0x67, 0x1A,0x0E, 0x1A,0x03, 0
10、x1A,0x03, 0x1A,0x67, 0x19,0x0E, 0x19,0x03, 0x1A,0x03, 0x19,0x03, 0x17,0x0D, 0x17,0x16, 0x15,0x03, 0x16,0x03, 0x17,0x03, 0x19,0x03, 0x17,0x03, 0x16,0x03, 0x15,0x0D, 0x15,0x03, 0x15,0x03, 0x16,0x03, 0x17,0x03, 0x1A,0x03, 0x17,0x03, 0x16,0x03, 0x15,0x03, 0x1F,0x15, 0x1F,0x03, 0x1A,0x03, 0x1F,0x03, 0x1A
11、,0x03, 0x19,0x0D, 0x19,0x03, 0x19,0x03, 0x1A,0x03, 0x19,0x03, 0x17,0x03, 0x16,0x03, 0x17,0x03, 0x16,0x0D, 0x16,0x03, 0x15,0x03, 0x10,0x03, 0x15,0x03, 0x15,0x03, 0x16,0x03, 0x15,0x00, 0x15,0x0B, 0x15,0x03, 0x1F,0x03, 0x1A,0x03, 0x1F,0x03, 0x20,0x03, 0x1F,0x0D, 0x1F,0x03, 0x1F,0x03, 0x20,0x03, 0x1F,0x
12、03, 0x1A,0x03, 0x1F,0x03, 0x21,0x03, 0x20,0x0D, 0x20,0x03, 0x1F,0x03, 0x1A,0x03, 0x1F,0x03, 0x20,0x02, 0x15,0x00, 0x00,0x00 ;/遇见uchar code Meet= 0x19,0x03, 0x17,0x0D, 0x17,0x02, 0x19,0x03, 0x16,0x0D, 0x16,0x02, 0x17,0x03, 0x16,0x0D, 0x16,0x03, 0x15,0x0D, 0x15,0x01, 0x15,0x03, 0x11,0x03, 0x10,0x03, 0
13、x11,0x03, 0x15,0x03, 0x11,0x0D, 0x15,0x03, 0x15,0x03, 0x16,0x03, 0x17,0x0D, 0x17,0x00, 0x19,0x03, 0x17,0x0D, 0x17,0x02, 0x19,0x03, 0x16,0x0D, 0x16,0x02, 0x17,0x03, 0x16,0x0D, 0x16,0x03, 0x15,0x0D, 0x15,0x01, 0x15,0x03, 0x11,0x03, 0x10,0x03, 0x11,0x03, 0x15,0x03, 0x11,0x0D, 0x11,0x03, 0x15,0x03, 0x15
14、,0x0D, 0x16,0x03, 0x15,0x15, 0x19,0x03, 0x17,0x0D, 0x17,0x02, 0x19,0x03, 0x16,0x0D, 0x16,0x02, 0x17,0x03, 0x16,0x0D, 0x16,0x03, 0x15,0x0D, 0x15,0x01, 0x15,0x03, 0x11,0x03, 0x10,0x03, 0x11,0x03, 0x15,0x03, 0x11,0x0D, 0x11,0x03, 0x15,0x0D, 0x15,0x03, 0x16,0x03, 0x17,0x00, 0x19,0x03, 0x17,0x0D, 0x17,0x
15、02, 0x19,0x03, 0x20,0x0D, 0x20,0x02, 0x1F,0x03, 0x1B,0x0D, 0x1B,0x03, 0x1F,0x0D, 0x1F,0x01, 0x15,0x03, 0x11,0x03, 0x10,0x03, 0x11,0x03, 0x15,0x03, 0x11,0x0D, 0x11,0x03, 0x15,0x03, 0x15,0x0D, 0x16,0x03, 0x15,0x15, 0x19,0x03, 0x1A,0x03, 0x1B,0x03, 0x1F,0x02, 0x1B,0x03, 0x1F,0x03, 0x1B,0x03, 0x1A,0x03,
16、 0x19,0x03, 0x1A,0x0D, 0x1A,0x03, 0x19,0x0D, 0x19,0x0C, 0x19,0x03, 0x15,0x03, 0x16,0x03, 0x17,0x03, 0x18,0x02, 0x17,0x03, 0x18,0x03, 0x19,0x03, 0x15,0x03, 0x16,0x03, 0x17,0x0D, 0x17,0x03, 0x17,0x0D, 0x17,0x16, 0x19,0x03, 0x1A,0x03, 0x1B,0x03, 0x1F,0x02, 0x1B,0x03, 0x1F,0x03, 0x20,0x03, 0x1F,0x03, 0x
17、20,0x03, 0x21,0x0D, 0x21,0x03, 0x19,0x0D, 0x19,0x0C, 0x19,0x03, 0x15,0x03, 0x16,0x03, 0x17,0x03, 0x18,0x02, 0x17,0x03, 0x18,0x03, 0x17,0x03, 0x16,0x0D, 0x16,0x03, 0x15,0x03, 0x11,0x03, 0x15,0x0D, 0x15,0x01, 0x00,0x00 ;/童话uchar code tale= 0x0F,0x67, 0x19,0x03, 0x18,0x03, 0x17,0x02, 0x17,0x03, 0x18,0x
18、04, 0x17,0x0E, 0x17,0x02, 0x17,0x03, 0x18,0x03, 0x17,0x03, 0x18,0x03, 0x17,0x03, 0x16,0x04, 0x15,0x18, 0x15,0x03, 0x17,0x03, 0x19,0x03, 0x1A,0x02, 0x1A,0x03, 0x1A,0x04, 0x19,0x0E, 0x19,0x03, 0x16,0x03, 0x16,0x03, 0x18,0x04, 0x17,0x0E, 0x17,0x15, 0x15,0x03, 0x17,0x03, 0x19,0x03, 0x1A,0x02, 0x1A,0x03,
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
10 积分
下载 | 加入VIP,下载更划算! |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 智能仪表 课程设计 制作