📄 shumaguan.c
字号:
#include<reg52.h>
void delay()
{
int i,j;
for(i=0;i<=400;i++)
for(j=0;j<=380;j++);
}
void main()
{
int lowno=0,highno;
int i=0,m=0;
int time[3]={3,1,2},led[3]={0xFB,0xFE,0xFD};
highno=time[0];
while(1)
{
P2=lowno;
P0=highno;
P1=led[i];
lowno--;
if(highno==0&&lowno==0)
{
m++;
i=m%3;
highno=time[i];
if(m==243) m=0;
}
if(lowno==-1)
{
lowno=9;
highno--;
}
delay();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -