Exemplo n.º 1
0
/* 
   setup a channels aux servo function
*/
void RC_Channel_aux::aux_servo_function_setup(void)
{
    switch (function) {
    case RC_Channel_aux::k_flap:
    case RC_Channel_aux::k_flap_auto:
    case RC_Channel_aux::k_egg_drop:
        set_range_out(0,100);
        break;
    case RC_Channel_aux::k_heli_rsc:
    case RC_Channel_aux::k_heli_tail_rsc:
        set_range_out(0,1000);
        break;
    case RC_Channel_aux::k_aileron_with_input:
    case RC_Channel_aux::k_elevator_with_input:
        set_angle(4500);
        break;
    case RC_Channel_aux::k_aileron:
    case RC_Channel_aux::k_elevator:
    case RC_Channel_aux::k_dspoiler1:
    case RC_Channel_aux::k_dspoiler2:
    case RC_Channel_aux::k_rudder:
    case RC_Channel_aux::k_steering:
    case RC_Channel_aux::k_flaperon1:
    case RC_Channel_aux::k_flaperon2:
        set_angle_out(4500);
        break;
    default:
        break;
    }

    if (function < k_nr_aux_servo_functions) {
        _function_mask |= (1ULL<<(uint8_t)function);
    }
}
Exemplo n.º 2
0
/* 
   setup a channels aux servo function
*/
void RC_Channel_aux::aux_servo_function_setup(void)
{
    switch (function) {
    case RC_Channel_aux::k_flap:
    case RC_Channel_aux::k_flap_auto:
    case RC_Channel_aux::k_egg_drop:
        set_range_out(0,100);
        break;
    case RC_Channel_aux::k_heli_rsc:
    case RC_Channel_aux::k_heli_tail_rsc:
        set_range_out(0,1000);
        break;
    case RC_Channel_aux::k_aileron_with_input:
    case RC_Channel_aux::k_elevator_with_input:
        set_angle(4500);
        break;
    case RC_Channel_aux::k_aileron:
    case RC_Channel_aux::k_elevator:
    case RC_Channel_aux::k_dspoiler1:
    case RC_Channel_aux::k_dspoiler2:
    case RC_Channel_aux::k_rudder:
    case RC_Channel_aux::k_steering:
    case RC_Channel_aux::k_flaperon1:
    case RC_Channel_aux::k_flaperon2:
        set_angle_out(4500);
        break;
    case RC_Channel_aux::k_motor_tilt:
        // tenth percentage tilt
        set_range_out(0,1000);
        break;
    case RC_Channel_aux::k_throttle:
        // fixed wing throttle
        set_range_out(0,100);
        break;
    default:
        break;
    }

    if (function < k_nr_aux_servo_functions) {
        set_function_mask((uint8_t)function.get());
    }
}
Exemplo n.º 3
0
void
RC_Channel::set_angle(int16_t angle)
{
    set_angle_in(angle);
    set_angle_out(angle);
}