修改了限位开关的判断逻辑

This commit is contained in:
2021-11-05 01:31:09 +08:00
parent a2d1502c30
commit a4d76b0005
4 changed files with 945 additions and 890 deletions
+6 -6
View File
@@ -451,18 +451,18 @@ void my_code()
moto.moto2a=0;
moto.moto2b=10;
}
if(key4.code!=0||(moto_in1==1&&READ_MOT_IN1==0))
if(key4.code!=0||(moto.moto1a==0&&moto.moto1b==0&&moto.moto2a==0&&moto.moto2b==0))
{
mode=1;
}
if(ADCC.adc_value[1]>400)
if(ADCC.adc_value[1]>400||(moto_in1==1&&READ_MOT_IN1==0))
{
//overload_times=0;
moto.moto1a=0;
moto.moto1b=0;
}
if(ADCC.adc_value[0]>400)
if(ADCC.adc_value[0]>400||(moto_in2==1&&READ_MOT_IN2==0))
{
moto.moto2a=0;
moto.moto2b=0;
@@ -500,17 +500,17 @@ void my_code()
moto.moto2a=10;
moto.moto2b=0;
}
if(key4.code!=0||(moto_in2==1&&READ_MOT_IN2==0))
if(key4.code!=0||(moto.moto1a==0&&moto.moto1b==0&&moto.moto2a==0&&moto.moto2b==0))
{
mode=1;
}
if(ADCC.adc_value[1]>400)
if(ADCC.adc_value[1]>400||(moto_in1==1&&READ_MOT_IN1==0))
{
//overload_times=0;
moto.moto1a=0;
moto.moto1b=0;
}
if(ADCC.adc_value[0]>400)
if(ADCC.adc_value[0]>400||(moto_in2==1&&READ_MOT_IN2==0))
{
//overload_times2=0;
moto.moto2a=0;