单片机实验程序_3.docx
《单片机实验程序_3.docx》由会员分享,可在线阅读,更多相关《单片机实验程序_3.docx(12页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
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=
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 单片机 实验 程序 _3
限制150内