Sub: Added joystick button arm/disarm

This commit is contained in:
Jacob Walser 2017-02-07 17:28:42 -05:00 committed by Andrew Tridgell
parent aab1f6ae69
commit aaf9bec83a
1 changed files with 7 additions and 1 deletions

View File

@ -145,13 +145,19 @@ void Copter::transform_manual_control_to_rc_override(int16_t x, int16_t y, int16
int16_t channels[8];
float rpyScale = 0.5;
float throttleScale = 1.0;
float throttleScale = 0.8;
int16_t rpyCenter = 1500;
int16_t throttleBase = 1500-500*throttleScale;
uint16_t mode = buttons;
int16_t camTilt = 1500;
if ( mode & (1 << 4) ) {
init_arm_motors(true);
} else if ( mode & (1 << 5) ) {
init_disarm_motors();
}
channels[0] = 1500; // pitch
channels[1] = 1500; // roll
channels[2] = z*throttleScale+throttleBase; // throttle