#include <REGX52.H>
#include <INTRINS.H>
//STC-ISP软件生成 延时1000ms
void Delay1000ms()() //@11.0592MHz
{
unsigned char i, j, k;
_nop_();
_nop_();
i = 43;
j = 6;
k = 203;
do
{
do
{
while (--k);
} while (--j);
} while (--i);
}
void main()
{
while(1){
P2 = 0xFE; //1111 1110
Delay1000ms();
P2 = 0xFD; //1111 1101
Delay1000ms();
P2 = 0xFB; // 1111 1011
Delay1000ms();
P2 = 0xF7; // 1111 0111
Delay1000ms();
P2 = 0xEF; //1110 1111
Delay1000ms();
P2 = 0xDF; //1101 1111
Delay1000ms();
P2 = 0xBF; //1011 1111
Delay1000ms();
P2 = 0x7F; //0111 1111
Delay1000ms();
}
}
51单片机流水灯
最新推荐文章于 2024-06-15 20:54:34 发布