Robot Control Library
servo.h File Reference

Go to the source code of this file.

Macros

#define RC_SERVO_CH_MIN   1
 servo channels range from 1-8 More...
 
#define RC_SERVO_CH_MAX   8
 servo channels range from 1-8 More...
 
#define RC_SERVO_CH_ALL   0
 providing this as an argument writes the same pulse to all channels More...
 
#define RC_ESC_DEFAULT_MIN_US   1000
 
#define RC_ESC_DEFAULT_MAX_US   2000
 
#define RC_ESC_DJI_MIN_US   1120
 
#define RC_ESC_DJI_MAX_US   1920
 

Functions

int rc_servo_init (void)
 Configures the PRU to send servo pulses. More...
 
void rc_servo_cleanup (void)
 Cleans up servo functionality and turns off the power rail. More...
 
int rc_servo_power_rail_en (int en)
 enables or disables the 6V power rail to drive servos. More...
 
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. More...
 
int rc_servo_send_pulse_us (int ch, int us)
 Sends a single pulse of desired width in microseconds to one or all channels. More...
 
int rc_servo_send_pulse_normalized (int ch, double input)
 Like rc_send_pulse_us but translates a desired servo position from -1.5 to 1.5 to a corresponding pulse width from 600 to 2400us. More...
 
int rc_servo_send_esc_pulse_normalized (int ch, double input)
 Like rc_send_pulse_normalized but translates a desired esc throttle position from 0 to 1.0 to a corresponding pulse width from 1000 to 2000us. More...
 
int rc_servo_send_oneshot_pulse_normalized (int ch, double input)
 Like rc_send_pulse_normalized but translates a desired esc throttle position from 0 to 1.0 to a corresponding pulse width from 125 to 250us. More...