Browse Source

Copter: Sprayer enable added to CH7/CH8 switch

mission-4.1.18
Randy Mackay 12 years ago
parent
commit
e1fe4946fb
  1. 8
      ArduCopter/control_modes.pde
  2. 1
      ArduCopter/defines.h

8
ArduCopter/control_modes.pde

@ -98,6 +98,7 @@ static void init_aux_switches() @@ -98,6 +98,7 @@ static void init_aux_switches()
case AUX_SWITCH_RESETTOARMEDYAW:
case AUX_SWITCH_SUPERSIMPLE_MODE:
case AUX_SWITCH_ACRO_TRAINER:
case AUX_SWITCH_SPRAYER:
do_aux_switch_function(g.ch7_option, ap_system.CH7_flag);
break;
}
@ -109,6 +110,7 @@ static void init_aux_switches() @@ -109,6 +110,7 @@ static void init_aux_switches()
case AUX_SWITCH_RESETTOARMEDYAW:
case AUX_SWITCH_SUPERSIMPLE_MODE:
case AUX_SWITCH_ACRO_TRAINER:
case AUX_SWITCH_SPRAYER:
do_aux_switch_function(g.ch8_option, ap_system.CH8_flag);
break;
}
@ -260,6 +262,12 @@ static void do_aux_switch_function(int8_t ch_function, uint8_t ch_flag) @@ -260,6 +262,12 @@ static void do_aux_switch_function(int8_t ch_function, uint8_t ch_flag)
g.acro_trainer = ACRO_TRAINER_LIMITED;
break;
}
#if SPRAYER == ENABLED
case AUX_SWITCH_SPRAYER:
sprayer.enable(ch_flag == AUX_SWITCH_HIGH);
break;
#endif
}
}

1
ArduCopter/defines.h

@ -66,6 +66,7 @@ @@ -66,6 +66,7 @@
#define AUX_SWITCH_RESETTOARMEDYAW 12 // changes yaw to be same as when quad was armed
#define AUX_SWITCH_SUPERSIMPLE_MODE 13 // change to simple mode in middle, super simple at top
#define AUX_SWITCH_ACRO_TRAINER 14 // low = disabled, middle = leveled, high = leveled and limited
#define AUX_SWITCH_SPRAYER 15 // enable/disable the crop sprayer
// values used by the ap.ch7_opt and ap.ch8_opt flags
#define AUX_SWITCH_LOW 0 // indicates auxiliar switch is in the low position (pwm <1200)

Loading…
Cancel
Save