资源描述:
《郭天祥单片机程序》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、#includesbitpl_l=PlAOunsignedintavoidmain(){whilc(l){a=51000;pI_l=0;while(a—);a=51000;while(a—);a=51000;while(a—);a=51000;while(a—);#include#defineuintunsignedint#defineucharunsignedcharsbitDl=PlAO;//voiddclay();voiddelay(uint);voidmain(){while(l){DI=0;delay(
2、lOO);Dl=l;delay(lOO);voiddelay(){uintx,y;for(x=100;x>0;x-)for(y=6(X):y>0;y—);)*/voiddelay(uintz){uintx;uchary;for(x=z;x>0;x—)for(y=20;y>0;y-);#include#include#defineuintunsignedint#defineucharunsignedcharuchartemp,num,num1;sbitbeep=P2A3;voiddelay(uint);void
3、main(){temp=0xfe;while(l){for(numl=0;numl<3;numl++){for(num=0;num<8;num++){Pl=temp;beep=0;delay(lOO);temp=_crol_(temp,1);Pl=Oxff;bccp=1;delay(lOO);}}for(numl=0;numl<3;numl++){for(num=0;num<8;num++){Pl=temp;beep=O;delay(lOO);temp=_cror_(temp,1);Pl=Oxff;beep=1;delay(lOO);}}while
4、(l);voiddelay(uintz){uintx,y;for(x=z;x>0;x—)for(y=l10;y>0;y—);Lesson3-1#includesbitdula=P2A6;sbitwela=P2A7;voidmain(){wela=l;P0=0xc0;wela=0;dula=l;P0=0x06;dula=0;while(l);#include#defineuintunsignedint#defineucharunsignedcharsbitdula=P2A6;sbitvela=P2A7;uchar
5、num;ucharcodetable[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71);voiddelay(uintz);voidmain(){wela=l;//11101010P0=0xea;wela=0;while(l){for(num=0;num<16;num++){dula=l;P0=table[num];dula=0;delay(lOOO);}}}voiddelay(uintz){uintx,y;for(x=z;x>0;x
6、~)for(y=l10;y>0;y—);Lesson3-3#include#defineuintunsignedint#defineucharunsignedcharsbitdula=P2A6;sbitwcla=P2A7;sbitdl=PlAO;ucharnum;ucharcodetable[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71);voiddelay(uintz);voidmain(){EA=1;//开总
7、中断EX0=l;//开外部中断0//1TO=1;TCON=0x01;wcla=l;//ll101010P0=0xca;wela=0;while(l){for(num=0;num<16;num++){dl=l;dula=l;P()=table[num];dula=0;delay(IOOO);}}}voiddclay(uintz){uintx,y;for(x=z;x>0;x—)for(y=l10;y>0;y~);voidexterO()intermpt0{dl=0;Lesson3-4#include#defineuintunsigne
8、dint#defineucharunsignedcharsbitdula=P2A6;sbitwela=P2A7;sbitd