#include <stdint.h>
#include <conf_general.h>
Go to the source code of this file.
float servodec_get_last_pulse_len |
( |
int |
servo_num | ) |
|
Get the length of the last received pulse.
- Parameters
-
servo_num | The servo index. If it is out of range, 0.0 will be returned. |
- Returns
- The length of the last received pulse.
float servodec_get_servo |
( |
int |
servo_num | ) |
|
Get a decoded servo value.
- Parameters
-
servo_num | The servo index. If it is out of range, 0.0 will be returned. |
- Returns
- The servo value in the range [-1.0 1.0].
uint32_t servodec_get_time_since_update |
( |
void |
| ) |
|
Get the amount of milliseconds that has passed since the last time servo positions were received.
- Returns
- The amount of milliseconds that have passed since an update.
void servodec_init |
( |
void(*)(void) |
d_func | ) |
|
Initialize the serve decoding driver.
- Parameters
-
d_func | A function that should be called every time the servo signals have been decoded. Can be NULL. |
void servodec_set_pulse_options |
( |
float |
start, |
|
|
float |
end, |
|
|
bool |
median_filter |
|
) |
| |
Change the limits of how the servo pulses should be decoded.
- Parameters
-
start | The amount of milliseconds the pulse starts at (default is 1.0) |
end | he amount of milliseconds the pulse ends at (default is 2.0) |