51单片机应用实例小制作Word格式.docx

上传人:b****1 文档编号:14251672 上传时间:2022-10-20 格式:DOCX 页数:23 大小:137.29KB
下载 相关 举报
51单片机应用实例小制作Word格式.docx_第1页
第1页 / 共23页
51单片机应用实例小制作Word格式.docx_第2页
第2页 / 共23页
51单片机应用实例小制作Word格式.docx_第3页
第3页 / 共23页
51单片机应用实例小制作Word格式.docx_第4页
第4页 / 共23页
51单片机应用实例小制作Word格式.docx_第5页
第5页 / 共23页
点击查看更多>>
下载资源
资源描述

51单片机应用实例小制作Word格式.docx

《51单片机应用实例小制作Word格式.docx》由会员分享,可在线阅读,更多相关《51单片机应用实例小制作Word格式.docx(23页珍藏版)》请在冰豆网上搜索。

51单片机应用实例小制作Word格式.docx

GIF:

按下后进入动画显示模式。

2>

WORLD:

按下后进入文字显示模式。

3>

MUSIC:

按下后进入音乐模式,由于51硬件限制,暂时不能同时显示16x16点阵。

4>

NEXT:

按下后,切换当前模式的下一个内容。

为循环播放。

3、滑动变阻器:

音乐模式下调节音量大小。

注意事项:

1、程序代码由于在world中保存格式原因,复制到编译软件后可能会出现错误。

或可以向本人索要源代码。

2、由于本程序内容较多,占用内存较大,89c51的内存放不下,因此需要用89c52或更高版本芯片。

它们只是内存大小不容。

程序代码:

main.c

#include<

REG52.H>

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,96,12,48,24,24,48,12,96,6,192,3,128,1,192,3,96,6,48,12,24,24,12,48,6,96,3,192,

64,2,64,2,64,2,64,2,64,2,64,2,127,254,0,0,0,0,127,254,64,2,64,2,64,2,64,2,64,2,64,2,

32,4,32,4,32,4,32,4,32,4,63,252,0,0,0,0,0,0,0,0,63,252,32,4,32,4,32,4,32,4,32,4,

16,8,16,8,16,8,16,8,31,248,0,0,0,0,0,0,0,0,0,0,0,0,31,248,16,8,16,8,16,8,16,8,

8,16,8,16,8,16,15,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,240,8,16,8,16,8,16,

4,32,4,32,7,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,224,4,32,4,32,

2,64,3,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,192,2,64,

1,128,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,0,0,1,128,

//动画一

ucharcodejif2[8][32]={

0,0,0,0,0,0,96,6,144,9,8,16,8,16,8,16,16,8,32,4,64,2,128,1,0,0,0,0,0,0,0,0,

0,0,0,0,0,0,96,6,144,9,8,16,8,16,8,16,16,8,32,4,64,2,128,1,0,0,0,0,0,0,0,0,

0,0,0,0,56,28,68,34,130,65,2,64,2,64,2,64,4,32,8,16,16,8,32,4,64,2,128,1,0,0,0,0,

0,0,56,28,68,34,130,65,1,128,1,128,1,128,1,128,2,64,4,32,8,16,16,8,32,4,64,2,128,1,0,0

//动画二:

心跳

ucharcodejif3[]={

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,0,0,0,0,0,0,

160,0,224,0,64,0,64,0,64,0,240,1,188,7,190,15,191,63,191,127,191,63,254,31,249,127,253,143,253,79,255,39,

255,39,254,19,254,19,250,9,225,4,1,6,1,3,134,1,248,0,64,0,64,0,64,0,240,1,224,0,64,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,0,0,0,0,0,0,0,0,0

//动画三:

一箭穿心

ucharcodeworld1[]={

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,0,0,0,0,0,0,//

8,16,248,31,128,16,64,0,64,0,64,16,128,31,0,16,0,0,128,12,64,18,64,17,64,17,128,31,0,16,0,0,

64,64,192,127,128,80,64,16,64,16,64,16,128,15,0,0,64,64,192,127,128,80,64,16,64,16,64,16,128,15,0,0,

64,64,192,64,64,71,0,56,0,12,64,3,192,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

8,0,248,31,128,16,64,16,64,16,64,16,128,15,0,0,0,0,64,16,64,16,208,31,0,16,0,16,0,0,0,0,

64,16,64,16,192,31,128,16,64,16,64,0,192,0,0,0,0,0,64,0,64,0,240,15,64,16,64,16,0,0,0,0,

8,16,248,31,128,16,64,0,64,0,64,16,128,31,0,16,0,0,128,15,64,16,64,16,64,16,72,8,248,31,0,16,

0,0,128,12,64,18,64,17,64,17,128,31,0,16,0,0,64,64,192,64,64,71,0,56,0,12,64,3,192,0,64,0,

//happybirthday

ucharcodeworld2[]={

0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 经管营销 > 公共行政管理

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1