|
#include<reg51.h>
#include<intrins.h>
void delay(unsigned int x)
{
unsigned int i,j;
for(i=0;i<x;i++)
for(j=0;j<110;j++);
}
void main()
{
unsigned char led1;
unsigned char led2;
unsigned char flag1,flag2;
while(1)
{
flag1=0;flag2=0;
led1=0xfe;;
led2=0xbf;
while(flag1!=8)
{
P2=led1;
led1=_crol_(led1,1);
delay(500);
flag1++;
}
while(flag2!=6)
{
P2=led2;
led2=_cror_(led2,1);
delay(500);
flag2++;
}
}
}
|
-
-
流水灯.rar
18.45 KB, 下载次数: 0, 下载积分: 黑币 -5
|