since I only have a six channel TX, there are only two channels left for selecting different flight modes. (like acro, horizon, RTH, PosHold...). To make the problem worse, I like to change the pitch angle for my flight cam. So I use the MULTIPLE_CONFIGURATION_PROFILES option to change the options for different flight modes and when AUX1 is not used for any boxoption, use it for controlling the cam.
Code:
in config.h added:
Code: Select all
#define TILT_PITCH_AUX_CH AUX1
in output.cpp changed:
Code: Select all
#if defined(SERVO_TILT)
servo[0] = get_middle(0);
if (rcOptions[BOXCAMSTAB]) {
servo[0] += ((int32_t)conf.servoConf[0].rate * att.angle[PITCH]) /50L;
servo[1] += ((int32_t)conf.servoConf[1].rate * att.angle[ROLL]) /50L;
}
#endif
to
Code: Select all
#if defined(SERVO_TILT)
servo[0] = get_middle(0);
#if defined(TILT_PITCH_AUX_CH)
uint16_t auxused = 0;
for(i=0;i<CHECKBOXITEMS;i++) //check if AUX Channel is used to set any option (there must be a simpler way)
auxused += ((7 << ((TILT_PITCH_AUX_CH - AUX1))) & conf.activate[i]) > 0;
if (! (auxused))
servo[0] += rcData[TILT_PITCH_AUX_CH] - 1500;
#endif
if (rcOptions[BOXCAMSTAB] || f.ARMED) { // activate CAMSTAB if copter is armed to save AUX option
servo[0] += ((int32_t)conf.servoConf[0].rate * att.angle[PITCH]) /50L;
servo[1] += ((int32_t)conf.servoConf[1].rate * att.angle[ROLL]) /50L;
}
#endif
I don't really understand how the different boxoptions are assigned to the AUX chanels. The above code works fine, but is there a simpler way to see which options are set by a specific AUX chanel?
Edit:
code base is MultiWii_2.3-navi-b4-xmas by EOSBandi