标签:oid sbit signed while char unsigned main 跑马灯 clu
#include <reg52.h>
#include <intrins.h>
sbit LED0 = P0^0;
sbit LED1 = P0^1;
sbit LED2 = P0^2;
sbit LED3 = P0^3;
sbit LED4 = P0^4;
sbit LED5 = P0^5;
sbit LED6 = P0^6;
sbit LED7 = P0^7;
void Delay100ms() //@11.0592MHz
{
unsigned char i, j;
i = 180;
j = 73;
do
{
while (--j);
} while (--i);
}
void main(){
while(1){
LED7=1;
LED0 = 0;
Delay100ms();
LED0 = 1;
LED1 = 0;
Delay100ms();
LED1 = 1;
LED2 = 0;
Delay100ms();
LED2 = 1;
LED3 = 0;
Delay100ms();
LED3 = 1;
LED4 = 0;
Delay100ms();
LED4 = 1;
LED5 = 0;
Delay100ms();
LED5 = 1;
LED6 = 0;
Delay100ms();
LED6 = 1;
LED7 = 0;
Delay100ms();
}
}
标签:oid sbit signed while char unsigned main 跑马灯 clu
原文地址:https://www.cnblogs.com/maycpou/p/13549017.html