#include <REGX52.H>
#include <INTRINS.H>
void Delay(unsigned int xms) //@11.0592MHz
{
unsigned char i, j;
while(xms--)
{
_nop_();
i = 2;
j = 199;
do
{
while (--j);
} while (--i);
}
}
void main()
{
while(1)
{
P2=0xFE;
Delay(200); //Delay(),随意设置延时时间给程序带来更方便的编写
P2=0xFD;
Delay(400);
P2=0xFB;
Delay(600);
P2=0xF7;
Delay(800);
P2=0xEF;
Delay(1000);
P2=0xDF;
Delay(1200);
P2=0xBF;
Delay(1400);
P2=0x7F;
Delay(1600);
}
}