单片机C语言编程:让8个LED流水灯以0.2s时间间隔从左到右依次点亮然后重复实现
单片机C语言编程:让8个LED流水灯以0.2s时间间隔从左到右依次点亮然后重复实现
日期:2018-03-08 13:58:41 人气:1
#include
#include
void delay(unsigned int z );
void main()
{
unsigned int a;
unsigned char b=0xfe;
for(a=0;a<8;a++)
{
P1=b;//P1口接8个LED灯
delay(200);
b=_crol_ (b,1);
}
}
vo