From aaf9bec83a69823cc451654da8c868cac1e67c3a Mon Sep 17 00:00:00 2001 From: Jacob Walser Date: Tue, 7 Feb 2017 17:28:42 -0500 Subject: [PATCH] Sub: Added joystick button arm/disarm --- ArduSub/radio.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ArduSub/radio.cpp b/ArduSub/radio.cpp index f18fdb684b..1dacc51c15 100644 --- a/ArduSub/radio.cpp +++ b/ArduSub/radio.cpp @@ -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