This is the latest (main) BeagleBoard documentation. If you are looking for stable releases, use the drop-down menu on the bottom-left and select the desired version.

Function rc_servo_set_esc_range

Function Documentation

int rc_servo_set_esc_range(int min, int max)

Sets the pulse width range used by the rc_servo_esc_send_pulse_normalized() function.

This function is not necessary when using the default range which is RC_ESC_DEFAULT_MIN_US (1000) to RC_ESC_DEFAULT_MAX_US (2000). This is only neccessary when using custom ranges. The most common need for this is when dealing with DJI motor drivers which cannot be calibrated. In this case use the line:

rc_servo_set_esc_range(RC_ESC_DJI_MIN_US, RC_ESC_DJI_MAX_US);

This will set the range to 1120-1920 for DJI motor drivers. Note that the minimum value is what is sent when calling rc_servo_usc_send_pulse_normalized with a desired motor control input of 0. A slightly negative value is still possible which will send a pulse width shorter than the minimum value given here. These negative values shoul dbe avoided with DJI motor drivers as they don’t register.

Parameters
  • min[in] The minimum pulse width in microseconds

  • max[in] The maximum pulse width in microseconds

Returns

0 on success, -1 on failure.