标题:
51单片机流水灯跑马灯
[打印本页]
作者:
保持微笑
时间:
2020-10-2 18:17
标题:
51单片机流水灯跑马灯
#include <reg52.h>//头文件
void ys(unsigned int q)
{
unsigned int w,e;
for(w=0;w<q;w++)
for(e=0;e<1000;e++);
}
void main()
{
unsigned char q=0xfe;
while(1)
{
P1=q;
ys(100);
q=q>>7|q<<1;
}
}
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1