My receivers (35MHz) usually go nuts when they loose radio signal.
If I turn OFF the TX the RX can turn the servos off limits and strip their gears, the motor can suddenly start...
Even in Waypoint mode I see that this happens, since you always have control over the servos from the IN-signal pins.
For testing purposes, and maybe in a situation were you loose signal, I want to programmatically turn ON the autopilot (WP-mode) and SHUT DOWN IN-signal 1-3.
I created a FORCE-WP-MODE flag which runs this in the main loop:
pinMode(1, OUTPUT); //CTRL
pinMode(4, OUTPUT); //MUX
digitalWrite(1, LOW); //CTRL - Shut down CTRL signal
digitalWrite(4, HIGH); //MUX - Turn on WP-mode
Also, In the read_Ch1() and read_Ch2() I return "0" if FORCE-WP-MODE flag is set to reject any random inputs.
Need to do some more testing, but It seems to work.
But I think I still saw some random noise when I connected the GPS. Need to check that again...
- Is there a better approach?