diff --git a/flix/safety.ino b/flix/safety.ino index 855e3d1..4e7e9dc 100644 --- a/flix/safety.ino +++ b/flix/safety.ino @@ -38,7 +38,7 @@ void descend() { // Allow pilot to interrupt automatic flight void autoFailsafe() { static float roll, pitch, yaw, throttle; - if (roll != controlRoll || pitch != controlPitch || yaw != controlYaw || abs(throttle - controlThrottle) > 0.05) { + if (abs(roll - controlRoll) > 0.05 || abs(pitch - controlPitch) > 0.05 || abs(yaw - controlYaw) > 0.05 || abs(throttle - controlThrottle) > 0.05) { // controls changed and mode switch is not configured if (mode == AUTO && invalid(controlMode)) mode = STAB; // regain control by the pilot }