#include<reg52.h>
#define uint unsigned int //宏定义int
void delay(uint z) //延时函数
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
void main()
{
while(1)
{
P0=0xfe;
delay(15);
P0=0xfd;
delay(15);
P0=0xfb;
delay(15);
P0=0xf8;
delay(15);
P0=0x10;
delay(15);
P0=0x20;
delay(15);
P0=0x40;
delay(15);
P0=0x80;
delay(15);
}
} |