configuration swich on in TX RC

HelloI am new here.I bought a Ardupilot in sparkfun to use it in FPV I upload de v 1.0 of the software for ardupilotI need help to configure the ardupilot with my transmitter.Ok. I have a 3 position swich in my transmitter and i would like to use this swich shared with the FMA copilot in this configuration:Swich down= Ardulipot and copilot OFFSwich in the middle= Copilot ON ardupilot OFFSwich UP= Copilot + Ardupilot ONThe problem is that actually whern I put the swich in the middle the ardupilot became a ON, but I can not find in wich part of the code can I setup the pulses to put On the ardupilot only when the swich is in the Up posisiton.Plase can some one help me??Thaks a lot in advanceBest regards

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • 3D Robotics
    You asked the same question at RC Groups and I answered you there.

    Short answer: copy this code from ArduPilot 2.0:

    byte Tx_Switch_Status(void) //Return zero when we are in manual mode, return 2 when autopilot mode 0, return 3 when autopilot mode 1...
    {
    if(digitalRead(4)==HIGH)
    {
    if(digitalRead(5)==HIGH)
    return 0x01; // WP mode
    else
    return 0x02; // RTL mode
    }
    else
    return 0x00;
    }
    RC Groups - View Single Post - ArduPilot, an open source autopilot, now available ($24.95!)
    RC Groups - the most active Radio Control model community: electric and fuel rc airplanes,rc helis,rc boats and rc cars. Features discussion forums,…
  • Look for occurences of TX_Switch_Status() returning 0x02 ... which is defined as the middle position as returned by that function.
This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…