欢迎来到天天文库
浏览记录
ID:38065387
大小:17.00 KB
页数:3页
时间:2019-05-25
《终极流水灯单片机C语言程序》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、#include#include#defineuintunsignedintsbitbeep=P2^3;voidji_ou();voidsx();voidshanshuo();voidtwo_out_in_out();voidfour_out_in_out();voiddelay(uintz){uintx,y;for(x=z;x>0;x--)for(y=110;y>0;y--);}voidmain(){ji_ou();sx();two_out_in_out();four_out_in_out(
2、);shanshuo();P1=0xff;while(1);}voidji_ou(){uintt;for(t=0;t<3;t++){P1=0xaa;delay(300);P1=0x55;delay(300);}}voidsx(){uinta,i,j;for(j=0;j<3;j++){a=0xfe;for(i=0;i<8;i++){P1=a;//delay(200);beep=0;delay(50);beep=1;delay(50);a=_crol_(a,1);}a=0x7f;for(i=0;i<8;i++){P1=a;//delay
3、(200);beep=0;delay(50);beep=1;delay(50);a=_cror_(a,1);}}}voidtwo_out_in_out(){uinti,j;P1=0xff;for(i=0;i<3;i++){P1=0x7e;delay(300);P1=0xbd;delay(300);P1=0xdb;delay(300);P1=0xe7;delay(300);}P1=0xff;for(j=0;j<3;j++){P1=0xe7;delay(300);P1=0xdb;delay(300);P1=0xbd;delay(300)
4、;P1=0x7e;delay(300);}}voidfour_out_in_out(){uintk;P1=0xff;for(k=0;k<3;k++){P1=0x3c;delay(300);P1=0xc3;delay(300);}P1=0xff;for(k=0;k<3;k++){P1=0xc3;delay(300);P1=0x3c;delay(300);}}voidshanshuo(){uintk;P1=0xff;for(k=0;k<6;k++){P1=~P1;delay(300);beep=0;delay(50);beep=1;de
5、lay(50);}}
此文档下载收益归作者所有