单片机实验程序_3.docx

上传人:安*** 文档编号:19022152 上传时间:2022-06-03 格式:DOCX 页数:12 大小:15.71KB
返回 下载 相关 举报
单片机实验程序_3.docx_第1页
第1页 / 共12页
单片机实验程序_3.docx_第2页
第2页 / 共12页
点击查看更多>>
资源描述

《单片机实验程序_3.docx》由会员分享,可在线阅读,更多相关《单片机实验程序_3.docx(12页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、单片机实验程序一#include#include#defineucharunsignedcharsbitH1=P36;sbitH2=P37;sbitL1=P05;sbitL2=P06;sbitL3=P07;tab1=0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,0xff,0xff,0xff,0xff;tab2=0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3b,0x37,0x2f,0x1f;tab3=0xff,0xff,0xff,0xff,0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe;ta

2、b4=0x1f,0x2f,0x37,0x3b,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f;voidDelay1s()/11.0592MHzunsignedchari,j,k;for(i=10;i0;i-)for(j=200;j0;j-)for(k=250;k0;k-)voiddelay20ms()unsignedchari,j;for(i=100;i0;i-)for(j=60;j0;j-);voidflick()uchard;while(dwhile(1)n=b;y=(n%2);if(y=1)ucharx;for(x=0;x二#include#include

3、#defineucharunsignedcharsbitH1=P36;sbitH2=P37;sbitL1=P05;sbitL2=P06;sbitL3=P07;tab1=0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,0xff,0xff,0xff,0xff;tab2=0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3b,0x37,0x2f,0x1f;tab3=0xff,0xff,0xff,0xff,0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe;tab4=0x1f,0x2f,0x37,0x3b,0

4、x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f;voidDelay1s()/11.0592MHzunsignedchari,j,k;for(i=10;i0;i-)for(j=200;j0;j-)for(k=250;k0;k-)voiddelay10ms()unsignedchari,j,k;for(i=5;i0;i-)for(j=4;j0;j-)for(k=248;k0;k-);voidflick()uchard;while(dvoidmain()ucharb,y,n;flick();while(1)n=b;y=(n%2);if(y=1)ucharx;for(x=

5、0;xL3=1;if(!L1|!L2|!L3)delay10ms()if(!L1|!L2|!L3)b+=1;while(!L1|!L2|!L3);三#include#include#defineucharunsignedcharsbitH1=P36;sbitH2=P37;sbitL1=P05;sbitL2=P06;sbitL3=P07;tab1=0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,0xff,0xff,0xff,0xff;tab2=0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3b,0x37,0x2f,0x1f;t

6、ab3=0xff,0xff,0xff,0xff,0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe;tab4=0x1f,0x2f,0x37,0x3b,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f;voidDelay1s()/11.0592MHzunsignedchari,j,k;for(i=0;iucharx;for(x=0;x#include#defineucharunsignedcharsbitH1=P36;sbitH2=P37;sbitL1=P05;sbitL2=P06;sbitL3=P07;tab1=0xfe,0xfd,0x

7、fb,0xf7,0xef,0xdf,0xbf,0x7f,0xff,0xff,0xff,0xff;tab2=0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3b,0x37,0x2f,0x1f;tab3=0xff,0xff,0xff,0xff,0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe;tab4=0x1f,0x2f,0x37,0x3b,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f;voidDelay1s()/11.0592MHzunsignedcharh,i,j,k;for(h=0;hif(!

8、L1|!L2|!L3)b+=1;while(!L1|!L2|!L3);if(y=0)ucharx;for(x=0;x#include#defineucharunsignedcharsbitH1=P36;sbitH2=P37;sbitL1=P05;sbitL2=P06;sbitL3=P07;tab1=0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,0xff,0xff,0xff,0xff;tab2=0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3b,0x37,0x2f,0x1f;tab3=0xff,0xff,0xff,0xff,

9、0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe;tab4=0x1f,0x2f,0x37,0x3b,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f;voidDelay1s()/11.0592MHzunsignedcharh,i,j,k;for(h=0;h0;i-)for(j=145;j0;j-);voidflick()uchard;while(dL2=1;L3=1;if(!L1|!L2|!L3)Delay10ms();if(!L1|!L2|!L3)b+=1;while(!L1|!L2|!L3);if(y=0)ucharx;for(x=0;x#include#defineucharunsignedcharsbitH1=P36;sbitH2=P37;sbitL1=P05;sbitL2=P06;sbitL3=P07;

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 应用文书 > 培训材料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁