fix tank steering safety check
This commit is contained in:
parent
156455f363
commit
3c5cd0b1c3
|
@ -563,10 +563,10 @@ void calculateSetSpeed(unsigned long timediff){
|
|||
|
||||
|
||||
|
||||
if (control_buttonA && !control_buttonB && !reverse_enabled && throttle_pos<=0) { //Right button (A) only. and throttle touched
|
||||
if (control_buttonA && !control_buttonB && !reverse_enabled && throttle_pos>0) { //Right button (A) only. and throttle touched
|
||||
tanksteering_differential+=tanksteering_rate_increase*(timediff/1000.0);
|
||||
tanksteering_differential=constrain(tanksteering_differential,-1.0,1.0); //constrain between 0 and 1
|
||||
}else if(control_buttonB && !control_buttonA && !reverse_enabled && throttle_pos<=0) { //Left button (B) only. and throttle touched
|
||||
}else if(control_buttonB && !control_buttonA && !reverse_enabled && throttle_pos>0) { //Left button (B) only. and throttle touched
|
||||
tanksteering_differential-=tanksteering_rate_increase*(timediff/1000.0);
|
||||
tanksteering_differential=constrain(tanksteering_differential,-1.0,1.0); //constrain between 0 and 1
|
||||
}else{ //buttons released
|
||||
|
|
Loading…
Reference in New Issue