AP_Tuning: added a small dead-zone on mid-point detection
thanks to Leonard for the suggestion
This commit is contained in:
parent
aa38539ecb
commit
d72df80968
@ -177,8 +177,11 @@ void AP_Tuning::check_input(uint8_t flightmode)
|
||||
//hal.console->printf("chan_value %.2f last_channel_value %.2f\n", chan_value, last_channel_value);
|
||||
|
||||
if (mid_point_wait) {
|
||||
if ((chan_value > 0 && last_channel_value > 0) ||
|
||||
(chan_value < 0 && last_channel_value < 0)) {
|
||||
// see if we have crossed the mid-point. We use a small deadzone to make it easier
|
||||
// to move to the "indent" portion of a slider to start tuning
|
||||
const float dead_zone = 0.02;
|
||||
if ((chan_value > dead_zone && last_channel_value > 0) ||
|
||||
(chan_value < -dead_zone && last_channel_value < 0)) {
|
||||
// still waiting
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user