您的当前位置:首页正文

流水灯双反向 交替闪烁

2024-08-19 来源:客趣旅游网


#include

#define off 1

#define on 0

#define Led P1

unsigned char i;

unsigned char code

numtab[15]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};

void delay(unsigned char m)

{

unsigned int a,b,c;

for(a=0;afor(b=0;b<3;b++)

for(c=0;c<220;c++);

}

void main()

{

while(1)

{

if(i>=15)i=0;

Led=numtab[i];

delay(100);

i++;

}

}

因篇幅问题不能全部显示,请点此查看更多更全内容