|
From: | Tilman Baumann |
Subject: | Re: [Paparazzi-devel] Spektrum Receiver & patching main_ap.c/autopilot.h |
Date: | Thu, 14 Jun 2012 22:17:29 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20120506 Icedove/3.0.11 |
I got it to work. Quick summary. The Spektrum DX5e and possibly other entry level radios don't have a three way switch for mode selection. The workaround is to combine two regular throw switches. One will switch between MANUAL and AUTO <define name="RADIO_MODE" value="RADIO_GEAR"/> And the other one will, in case the MODE switch is on AUTO select between the different AUTO MODES. <define name="RADIO_AUTO_MODE" value="RADIO_AUX1"/> This way CH 5 in position 1 means MANUAL. With CH 5 in position 0 trainer in normal position means AUTO2 with trainer switch pulled AUTO1. It might obviously be convenient to replace the trainer switch with a bistable version. As for the code. Thanks Gareth and Felix for the inspiration and clarification. I re-used the TRESHOLD (typo?) mechanism which divides the range in upper and lower quarters. I guess that makes still sense even though the divider probably lies somewhere between min and max. A switch should be well in that range in either position. Also, I did not put the _expression_ in a macro like PPRZ_MODE_OF_PULSE(). I guess that is just not worth it. I can document that in the wiki. If you are happy with it. https://github.com/paparazzi/paparazzi/pull/216 On 14/06/12 16:06, Tilman Baumann wrote:
|
dual_switch.diff
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |