diff --git a/ArduCopter/control_modes.pde b/ArduCopter/control_modes.pde index 438bec2d6b..3d604f612d 100644 --- a/ArduCopter/control_modes.pde +++ b/ArduCopter/control_modes.pde @@ -139,8 +139,12 @@ static void auto_trim() led_mode = NORMAL_LEDS; clear_leds(); imu.save(); + //Serial.println("Done"); auto_level_counter = 0; + + // set TC + init_throttle_cruise(); } } } diff --git a/ArduCopter/radio.pde b/ArduCopter/radio.pde index faca5889c5..649ef66774 100644 --- a/ArduCopter/radio.pde +++ b/ArduCopter/radio.pde @@ -4,6 +4,13 @@ // ---------------------------------------------------------------------------- static byte failsafeCounter = 0; // we wait a second to take over the throttle and send the plane circling +static void default_dead_zones() +{ + g.rc_1.set_dead_zone(60); + g.rc_2.set_dead_zone(60); + g.rc_3.set_dead_zone(60); + g.rc_4.set_dead_zone(200); +} static void init_rc_in() { @@ -29,14 +36,9 @@ static void init_rc_in() g.rc_4.dead_zone = 300; */ - g.rc_1.set_dead_zone(60); - g.rc_2.set_dead_zone(60); - g.rc_3.set_dead_zone(60); - g.rc_4.set_dead_zone(200); //set auxiliary ranges g.rc_5.set_range(0,1000); - g.rc_5.set_filter(false); g.rc_6.set_range(0,1000); g.rc_7.set_range(0,1000); g.rc_8.set_range(0,1000); diff --git a/libraries/RC_Channel/RC_Channel.cpp b/libraries/RC_Channel/RC_Channel.cpp index 11af18e10a..d290dd01cd 100644 --- a/libraries/RC_Channel/RC_Channel.cpp +++ b/libraries/RC_Channel/RC_Channel.cpp @@ -38,7 +38,7 @@ RC_Channel::set_angle(int angle) void RC_Channel::set_dead_zone(int dzone) { - _dead_zone = abs(dzone >>1); + _dead_zone.set_and_save(abs(dzone >>1)); } void diff --git a/libraries/RC_Channel/RC_Channel.h b/libraries/RC_Channel/RC_Channel.h index 9ce43fd1c0..1bbe02fd58 100644 --- a/libraries/RC_Channel/RC_Channel.h +++ b/libraries/RC_Channel/RC_Channel.h @@ -26,9 +26,10 @@ class RC_Channel{ radio_trim(&_group, 1, 1500, name ? PSTR("TRIM") : 0), radio_max (&_group, 2, 1900, name ? PSTR("MAX") : 0), _high(1), - _filter(true), + _filter(false), _reverse (&_group, 3, 1, name ? PSTR("REV") : 0), - _dead_zone(0), + _dead_zone (&_group, 4, 0, name ? PSTR("DZ") : 0), + //_dead_zone(0), scale_output(1.0) {} @@ -97,7 +98,8 @@ class RC_Channel{ bool _filter; AP_Int8 _reverse; - int16_t _dead_zone; // used to keep noise down and create a dead zone. + AP_Int16 _dead_zone; + //int16_t _dead_zone; // used to keep noise down and create a dead zone. uint8_t _type; int16_t _high; int16_t _low;