资源描述:
《基于51单片机多功能音乐播放器的设计》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、学习情境1多功能音乐播放器的设计江西环境工程职业学院机械与电子学院一、引言二、设计任务与设计原理1、设计任务(1)可播放多首音乐,且通过按键来选择播放的音乐(2)选择音乐时,音乐名称在LCD上显示(3)音乐播放种类跨度要大一些,播放声音要清晰2、设计原理三、硬件电路设计1系统框图图2-1-1系统框图2电路原理图(1)、单片机最小系统电路,主要由:时钟振荡电路、复位电路、电源电路等组成。图2-1-2单片机最小系统电路(2)、矩阵键盘输入电路图2-1-3矩阵键盘输入电路(3)、LCD12864显示电路图2-1-4LCD12864显示电
2、路(4)、蜂鸣器播放电路图2-1-5蜂鸣器播放电路2整体电路原理图图2-1-6系统仿真效果图一、软件设计1、流程图设计2、完整程序代码整个KEIL工程文件有4个.C文件和1个头文件组成,具体代码如下:(1)PlayMusic.c#include#include"SoundPlay.h"#include#defineucharunsignedchar#defineuintunsignedintsbitWAI_INT0=P3^2;//复位//水平与垂直偏移ucharH_Offset=0;//uchar
3、V_page_Offset=0;externucharKey_Num;externucharcodeName_Of_Song[];externucharKeyScan();//矩阵键盘扫描子程序externvoidLCD12864_Initialization();externvoidDisplay_Word(ucharP2,ucharL2,uchar*M)reentrant;externvoidDisplay_char(ucharP1,ucharL1,uchar*M)reentrant;voiddelay(uintK);//延时
4、子程序voidkey_process();//矩阵键盘按键处理子程序voidDelay1ms(uintcount){unsignedinti,j;for(i=0;i5、x03,0x19,0x02,0x15,0x03,0x16,0x03,0x17,0x03,0x17,0x03,0x17,0x03,0x18,0x03,0x19,0x02,0x16,0x03,0x17,0x03,0x18,0x02,0x18,0x03,0x17,0x03,0x15,0x02,0x18,0x03,0x17,0x03,0x18,0x02,0x10,0x03,0x15,0x03,0x16,0x02,0x15,0x03,0x16,0x03,0x17,0x02,0x17,0x03,0x18,0x03,0x19,0x02,0x1A
6、,0x03,0x1B,0x03,0x1F,0x03,0x1F,0x03,0x17,0x03,0x18,0x03,0x19,0x02,0x16,0x03,0x17,0x03,0x18,0x03,0x17,0x03,0x18,0x03,0x1F,0x03,0x1F,0x02,0x16,0x03,0x17,0x03,0x18,0x03,0x17,0x03,0x18,0x03,0x20,0x03,0x20,0x02,0x1F,0x03,0x1B,0x03,0x1F,0x66,0x20,0x03,0x21,0x03,0x20,0x03,0x
7、1F,0x03,0x1B,0x03,0x1F,0x66,0x1F,0x03,0x1B,0x03,0x19,0x03,0x19,0x03,0x15,0x03,0x1A,0x66,0x1A,0x03,0x19,0x03,0x15,0x03,0x15,0x03,0x17,0x03,0x16,0x66,0x17,0x04,0x18,0x04,0x18,0x03,0x19,0x03,0x1F,0x03,0x1B,0x03,0x1F,0x66,0x20,0x03,0x21,0x03,0x20,0x03,0x1F,0x03,0x1B,0x03,
8、0x1F,0x66,0x1F,0x03,0x1B,0x03,0x19,0x03,0x19,0x03,0x15,0x03,0x1A,0x66,0x1A,0x03,0x19,0x03,0x19,0x03,0x1F,0x03,0x1B,0x03,0x1F