AC_Sprayer: turn on/off the spinner with the pump

This commit is contained in:
Randy Mackay 2013-08-04 23:24:40 +09:00
parent 74fb500efe
commit c7464f635c

View File

@ -148,11 +148,10 @@ AC_Sprayer::update()
// if spraying update the pump servo position
if (_spraying) {
RC_Channel_aux::move_servo(RC_Channel_aux::k_sprayer_pump, min(ground_speed * _pump_pct_1ms,10000),0,10000);
}else{
// ensure sprayer is off
RC_Channel_aux::set_radio_to_min(RC_Channel_aux::k_sprayer_pump);
}
// send output to spinner servo
RC_Channel_aux::set_radio(RC_Channel_aux::k_sprayer_spinner, _spinner_pwm);
}else{
// ensure sprayer and spinner are off
RC_Channel_aux::set_radio_to_min(RC_Channel_aux::k_sprayer_pump);
RC_Channel_aux::set_radio_to_min(RC_Channel_aux::k_sprayer_spinner);
}
}