Defined in File servo.h
int rc_servo_send_pulse_us(int ch, int us)¶
Sends a single pulse of desired width in microseconds to one or all channels.
This function returns right away and the PRU manages the accurate timing of the pulse in the background. Therefore calling this function succesively for each channel will start the pulse for each channel at approximately the same time.
As described above, servos and ESCs require regular pulses of at least 5hz to function. Since these pulses do not have to be accurate in frequency, the user can use these functions to start pulses from a userspace program at convenient locations in their program, such as immediately when new positions are calculated from sensor values.
ch – [in] Channel to send signal to (1-8) or 0 to send to all channels.
us – [in] Pulse Width in microseconds
0 on success, -1 on failure