From f94727ed023918245ccf5fef96084d85c4d6fb01 Mon Sep 17 00:00:00 2001 From: Jason Short Date: Wed, 28 Dec 2011 22:37:44 -0800 Subject: [PATCH] added define for Max throttle --- ArduCopter/motors_hexa.pde | 2 +- ArduCopter/motors_octa.pde | 2 +- ArduCopter/motors_octa_quad.pde | 2 +- ArduCopter/motors_quad.pde | 4 +++- ArduCopter/motors_tri.pde | 2 +- ArduCopter/motors_y6.pde | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ArduCopter/motors_hexa.pde b/ArduCopter/motors_hexa.pde index 68946423c5..aed18d958d 100644 --- a/ArduCopter/motors_hexa.pde +++ b/ArduCopter/motors_hexa.pde @@ -17,7 +17,7 @@ static void output_motors_armed() int out_max = g.rc_3.radio_max; // Throttle is 0 to 1000 only - g.rc_3.servo_out = constrain(g.rc_3.servo_out, 0, 1000); + g.rc_3.servo_out = constrain(g.rc_3.servo_out, 0, MAXIMUM_THROTTLE); if(g.rc_3.servo_out > 0) out_min = g.rc_3.radio_min + MINIMUM_THROTTLE; diff --git a/ArduCopter/motors_octa.pde b/ArduCopter/motors_octa.pde index 34a3baec2c..c7705b43a5 100644 --- a/ArduCopter/motors_octa.pde +++ b/ArduCopter/motors_octa.pde @@ -17,7 +17,7 @@ static void output_motors_armed() int out_max = g.rc_3.radio_max; // Throttle is 0 to 1000 only - g.rc_3.servo_out = constrain(g.rc_3.servo_out, 0, 1000); + g.rc_3.servo_out = constrain(g.rc_3.servo_out, 0, MAXIMUM_THROTTLE); if(g.rc_3.servo_out > 0) out_min = g.rc_3.radio_min + MINIMUM_THROTTLE; diff --git a/ArduCopter/motors_octa_quad.pde b/ArduCopter/motors_octa_quad.pde index aab2d894aa..732dcdf64d 100644 --- a/ArduCopter/motors_octa_quad.pde +++ b/ArduCopter/motors_octa_quad.pde @@ -17,7 +17,7 @@ static void output_motors_armed() int out_max = g.rc_3.radio_max; // Throttle is 0 to 1000 only - g.rc_3.servo_out = constrain(g.rc_3.servo_out, 0, 1000); + g.rc_3.servo_out = constrain(g.rc_3.servo_out, 0, MAXIMUM_THROTTLE); if(g.rc_3.servo_out > 0) out_min = g.rc_3.radio_min + MINIMUM_THROTTLE; diff --git a/ArduCopter/motors_quad.pde b/ArduCopter/motors_quad.pde index 6b2dec9b7f..5bcf2b740b 100644 --- a/ArduCopter/motors_quad.pde +++ b/ArduCopter/motors_quad.pde @@ -16,7 +16,7 @@ static void output_motors_armed() int out_max = g.rc_3.radio_max; // Throttle is 0 to 1000 only - g.rc_3.servo_out = constrain(g.rc_3.servo_out, 0, 1000); + g.rc_3.servo_out = constrain(g.rc_3.servo_out, 0, MAXIMUM_THROTTLE); if(g.rc_3.servo_out > 0) out_min = g.rc_3.radio_min + MINIMUM_THROTTLE; @@ -26,6 +26,8 @@ static void output_motors_armed() g.rc_3.calc_pwm(); g.rc_4.calc_pwm(); + + if(g.frame_orientation == X_FRAME){ roll_out = g.rc_1.pwm_out * .707; pitch_out = g.rc_2.pwm_out * .707; diff --git a/ArduCopter/motors_tri.pde b/ArduCopter/motors_tri.pde index b50088f743..849eb1ab12 100644 --- a/ArduCopter/motors_tri.pde +++ b/ArduCopter/motors_tri.pde @@ -15,7 +15,7 @@ static void output_motors_armed() int out_max = g.rc_3.radio_max; // Throttle is 0 to 1000 only - g.rc_3.servo_out = constrain(g.rc_3.servo_out, 0, 1000); + g.rc_3.servo_out = constrain(g.rc_3.servo_out, 0, MAXIMUM_THROTTLE); if(g.rc_3.servo_out > 0) out_min = g.rc_3.radio_min + MINIMUM_THROTTLE; diff --git a/ArduCopter/motors_y6.pde b/ArduCopter/motors_y6.pde index 6e045b366c..fdd0f74417 100644 --- a/ArduCopter/motors_y6.pde +++ b/ArduCopter/motors_y6.pde @@ -18,7 +18,7 @@ static void output_motors_armed() int out_max = g.rc_3.radio_max; // Throttle is 0 to 1000 only - g.rc_3.servo_out = constrain(g.rc_3.servo_out, 0, 1000); + g.rc_3.servo_out = constrain(g.rc_3.servo_out, 0, MAXIMUM_THROTTLE); if(g.rc_3.servo_out > 0) out_min = g.rc_3.radio_min + MINIMUM_THROTTLE;