void speedlevel(uchar num1) //速度等级子程序,speed值越小,速度越高
{
if(zf_flag==0)
{
Coil_A1;
delay(speed);
Coil_B1;
delay(speed);
Coil_C1;
delay(speed);
Coil_D1;
delay(speed);
}
if(flag==1)
{
Coil_D1;
delay(speed);
Coil_C1;
delay(speed);
Coil_B1;
delay(speed);
Coil_A1;
delay(speed);
}
}
void display(uchar shi,uchar ge) //数码管显示子程序
{
duanxuan=1;
displayport=shuma[shi];
duanxuan=0;
displayport=0xff; //消影
weixuan=1;
displayport=0xfe;
weixuan=0;
delay(5);
duanxuan=1;
displayport=shuma[ge];
duanxuan=0;
displayport=0xff;
weixuan=1;
displayport=0xfd;
weixuan=0;
delay(5);
}
这是两个子程序,都是syntax erro near "void"错误,最后还有一个syntax erro near " "错误,找了半天都找不出来。