fix tank steering safety check

This commit is contained in:
interfisch 2024-07-14 16:46:33 +02:00
parent 156455f363
commit 3c5cd0b1c3
1 changed files with 2 additions and 2 deletions

View File

@ -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