#include <STC89C5xRC.H>
void Delay1ms(unsigned int xms) //@12.000MHz
{
unsigned char i, j;
while(xms)
{
i = 2;
j = 239;
do
{
while (--j);
} while (--i);
xms--;
}
}
void main()
{
while(1)
{
P2=0XFE;//1111 1110
Delay1ms(1000);
P2=0XFD;//1111 1101
Delay1ms(5000);
P2=0XFB;//1111 1011
Delay1ms(1200);
P2=0XF7;//1111 0111
Delay1ms(100);
P2=0XEF;//1110 1111
Delay1ms(1100);
P2=0XDF;//1101 1111
Delay1ms(500);
P2=0XBF;//1011 1111
Delay1ms(300);
P2=0X7E;//0111 1111
Delay1ms(700);
}
}
标签:P2,--,STC89C52,51,Delay1ms,1111,单片机,while,xms From: https://blog.51cto.com/u_15865347/6024114