upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
Go to the source code of this file.
Data Structures | |
struct | _es9257_context |
Functions | |
es9257_context | es9257_init (int32_t pin, int32_t min_pulse_width, int32_t max_pulse_width) |
void | es9257_halt (es9257_context dev) |
upm_result_t | es9257_set_angle (es9257_context dev, int32_t angle) |
upm_result_t | es9257_calc_pulse_travelling (const es9257_context dev, int32_t *ret_val, int32_t value) |
void | es9257_set_min_pulse_width (es9257_context dev, int width) |
void | es9257_set_max_pulse_width (es9257_context dev, int width) |
int | es9257_get_min_pulse_width (es9257_context dev) |
int | es9257_get_max_pulse_width (es9257_context dev) |
Macros | |
#define | ES9257_MIN_PULSE_WIDTH 475 |
#define | ES9257_MAX_PULSE_WIDTH 2100 |
#define | ES9257_PERIOD 20000 |
#define | ES9257_MAX_ANGLE 180.0 |
Typedefs | |
typedef struct _es9257_context * | es9257_context |
es9257_context es9257_init | ( | int32_t | pin, |
int32_t | min_pulse_width, | ||
int32_t | max_pulse_width | ||
) |
Instantiates a the servo at the given pin
pin | Servo pin number |
minPulseWidth | Minimum pulse width, in microseconds |
maxPulseWidth | Maximum pulse width, in microseconds |
void es9257_halt | ( | es9257_context | dev | ) |
Halts PWM for this servo and allows it to move freely.
upm_result_t es9257_set_angle | ( | es9257_context | dev, |
int32_t | angle | ||
) |
Sets the angle of the servo engine.
angle | Number between 0 and 180 |
void es9257_set_min_pulse_width | ( | es9257_context | dev, |
int | width | ||
) |
Sets the minimum pulse width
width | Minimum HIGH signal width |
void es9257_set_max_pulse_width | ( | es9257_context | dev, |
int | width | ||
) |
Sets the maximum pulse width
width | Maximum HIGH signal width |
int es9257_get_min_pulse_width | ( | es9257_context | dev | ) |
Returns the minimum pulse width
int es9257_get_max_pulse_width | ( | es9257_context | dev | ) |
Returns the maximum pulse width