📄 basic.h
字号:
void Basic()
{
uint t;
uchar num=0,m,n;
uchar line,setspeed=1;
bit sign=0; //走过白线
right=0;
left=0;
time=1;
a=1;
b=0;
line=0;
Cls();
second=0;
num=0;
Icount=0;
while(1)
{
num++ ;
if(num>=50)
{
if(Icount<3 && time<20) time++;
if(Icount>3 && time>0) time--;
num=0;
Icount=0;
}
if(speed>setspeed && time==0) {TR0=0;advance=0;back=1;for(t=0;t<1000;t++);back=0;TR0=1; }
if(!find_f)
{
if(find_l && !find_r) {right=0;left=1;}
if(find_r && !find_l){ left=0;right=1;}
}
else
{
left=0;
right=0;
if(!find_l && !find_r) sign=0;
}
if(find_l && find_r)
{
if(!sign){line++;sign=1;}
}
m=second/50;
disdat[3]=m%10;
disdat[2]=m/10;
display(0);
if(line==0x02)
{
a=0;
b=0;
second=0;
while(second<250)
{
m=second/50;
disdat[7]=5-m;
display(0);
n=second+30;
beep=0;
while(n>second);
beep=1;
while(m==second/50);
}
break;
}
while(!tf);
tf=0;
}
a=0;
b=1;
time=5;
right=0;
left=0;
second=0;
num=0;
t=0;
Icount=0;
while(1)
{
if(!find_l && !find_r) sign=0;
if(find_l && find_r)
{
if(!sign){line++;sign=1;}
}
m=second/50;
disdat[7]=m%10;
disdat[6]=m/10;
display(0);
num++;
if(num>=50)
{
num=0;
if(Icount<3 && time<20) time++;
if(Icount>3 && time>0) time--;
Icount=0;
}
if(line==3) {a=0;b=0;while(1);}
while(!tf);
tf=0;
/* while(1)
{
if(find_r && find_l)b=0;
} */
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -