paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] Spektrum Receiver & patching main_ap.c/autopilot.h


From: Tilman Baumann
Subject: Re: [Paparazzi-devel] Spektrum Receiver & patching main_ap.c/autopilot.h
Date: Thu, 05 Jul 2012 15:58:44 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

Wiki docu added http://paparazzi.enac.fr/wiki/RC_Receivers_and_Radios#Flight_mode_switch

On 14/06/12 22:17, Tilman Baumann wrote:
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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]