预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共18页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

51单片机应用实例小制作16x16点阵显示屏、蜂鸣器、独立键盘 制作:赵建业 日期:2016/12/1 原理图(总体) 原理图(芯片) 原理图(16x16LED点阵) 功能说明: 1、通电后进入问候界面。 2、四个按键(实时有效): 1>GIF:按下后进入动画显示模式。 2>WORLD:按下后进入文字显示模式。 3>MUSIC:按下后进入音乐模式,由于51硬件限制,暂时不能同时显示16x16点阵。 4>NEXT:按下后,切换当前模式的下一个内容。为循环播放。 3、滑动变阻器:音乐模式下调节音量大小。 注意事项: 1、程序代码由于在world中保存格式原因,复制到编译软件后可能会出现错误。或可以向本人索要源代码。 2、由于本程序内容较多,占用内存较大,89c51的内存放不下,因此需要用89c52或更高版本芯片。它们只是内存大小不容。 程序代码: main.c #include<REG52.H> #include<intrins.h> #include"yinfu.h"//自定义音符头文件 #defineucharunsignedchar #defineuintunsignedint #defineulongunsignedlong #defineKEYP2 sbitsound=P1^6; sbitMOSIO=P1^0; sbitR_CLK=P1^1; sbitS_CLK=P1^2; unsignedcharKeymun1,Keymun2;//存按键序号 unsignedcharKeystay;//按键状态,有按键按下为1,无按键按下为0 unsignedintC; unsignedcharx,y; ucharcodetab0[]={0x00,0x01,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x80, 0x01,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x80,0x00}; ucharcodehi[]={ 0,0,0,0,0,0,3,12,2,12,2,0,2,0,58,14,70,8,66,8,66,8,66,8,66,8,231,62,0,0,0,0 };//开机问候语:“hi” ucharcodejif1[22][32]={ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,1,128,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,192,3,64,2,64,2,192,3,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,224,7,32,4,160,5,160,5,32,4,224,7,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,240,15,16,8,208,11,80,10,80,10,208,11,16,8,240,15,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,248,31,8,16,232,23,40,20,168,21,168,21,40,20,232,23,8,16,248,31,0,0,0,0,0,0, 0,0,0,0,252,63,4,32,244,47,20,40,212,43,84,42,84,42,212,43,20,40,244,47,4,32,252,63,0,0,0,0, 0,0,254,127,2,64,250,95,10,80,234,87,42,84,170,85,170,85,42,84,234,87,10,80,250,95,2,64,254,127,0,0, 255,255,1,128,253,191,5,160,245,175,21,168,213,171,85,170,85,170,213,171,21,168,245,175,5,160,253,191,1,128,255,255, 128,1,128,1,128,1,128,1,128,1,128,1,128,1,255,255,255,255,128,1,128,1,128,1,128,1,128,1,128,1,128,1, 1,128,3,192,6,9