#include<reg51.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
//延时
void DelayMS(uint x)
{
uchar i;
while(x--)
{
for(i=0;i<120;i++);
}
}
//主程序
void main()
{
uint s;
while(1)
{
P0=0xfe;
DelayMS(150);
for(s=8;s>1;s--)
{
P0=_crol_(P0,1); //P0 的值向左循环移动
DelayMS(150);
}
P0=0x00;
DelayMS(150);
P0=0xff;
DelayMS(150);
}
}