51单片机流水灯程序

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

#include

void Delay(unsigned int t);

void main(){

while(1)

{
P1=0x7f;
Delay(200); P1=0xbf;
Delay(200);

P1=0xdf;
Delay(200);

P1=0xef;
Delay(200);

P1=0xf7;
Delay(200);

P1=0xfb;
Delay(200); P1=0xfd;
Delay(200);

P1=0xfe;
Delay(200);
P1=0xfe;
Delay(200);
P1=0xfd;
Delay(200);
P1=0xfb;
Delay(200);
P1=0xf7;
Delay(200);
P1=0xef;
Delay(200);
P1=0xdf;
Delay(200);
P1=0xbf;
Delay(200);
P1=0x7f;
Delay(200);
P1=0xe7;
Delay(200);
P1=0xdb;
Delay(200);
P1=0xbd;
Delay(200);
P1=0x7e;
Delay(200);
P1=0x7e;
Delay(200);
P1=0xbd;
Delay(200);
P1=0xdb;
Delay(200);
P1=0xe7;
Delay(200);
P1=0xf0;
Delay(500);
P1=0x0f;
Delay(200);
P1=0xf0;
Delay(200);
P1=0x0f;
Delay(200);
P1=0xf0;
Delay(200);
P1=0x0f;
Delay(200);
P1=0x18;
Delay(200);
P1=0xe7;
Delay(200);
P1=0x18;
Delay(200);
P1=0xe7;
Delay(200);
P1=0x18;
Delay(200);
P1=0xe7;
Delay(200);
P1=0x00;
Delay(200);
P1=0xff;
Delay(200);
P1=0x00;
Delay(200);
P1=0xff;
Delay(200);
P1=0x00;
Delay(200);
P1=0xff;
Delay(200);
P1=0x3c;
Delay(200);
P1=0xc3;
Delay(200);
P1=0x3c;
Delay(200);
P1=0xc3;
Delay(200);
P1=0x3c;
Delay(200);
P1=0xc3;
Delay(200);
P1=0x3f;
Delay(200);
P1=0xcf;
Delay(200);
P1=0xf3;
Delay(200);
P1=0xfc;
Delay(200);
P1=0xfc;
Delay(200);
P1=0xf3;
Delay(200);
P1=0xcf;
Delay(200);
P1=0x3f;
Delay(200);
P1=0xaa;
Delay(200);
P1=0x55;
Delay(200);
P1=0xaa;
Delay(200);
P1=0x55;
Delay(200);
P1=0xaa;
Delay(200);
P1=0x55;
Delay(200);
}

}
void Delay(unsigned int t)
{
unsigned int i,j;

for(i=0;ifor(j=0;j<112;j++);
}

相关文档
最新文档