13#include "pico/stdlib.h"
20#define PHASE_CORRECT false
22#define PERIOD_us 20000
The basic PWM function.
Definition hw_pwm.h:23
void set_pos(int pos)
the command to set the position of the motor.
Definition sg90.cpp:16
PWM * pwm
the PWM slice that handle the SG90 step motor device
Definition sg90.h:51
SG90(struct_ConfigSG90 sg90_config)
Construct a new SG90 object.
Definition sg90.cpp:4
int pos_max_deg
maximum position in degrees. Typically 180° or +90°.
Definition sg90.h:59
uint command
the gpio pin used to command the servo motor. Correspond to the B channel of the PWM slice
Definition sg90.h:53
uint sync
n auxilliary pulse that can be used as a synchro signal. Correspond to the A channel of the PWM slice
Definition sg90.h:55
float coef_us_per_degree
the coversion coefficient in microseconds per degree
Definition sg90.h:61
int pos_min_deg
minimum position in degrees. Typically 0° or -90°.
Definition sg90.h:57
the data set that configures the SG90 motor
Definition sg90.h:32
uint sync_pin
an auxilliary pulse that can be used as a synchro signal. Correspond to the A channel of the PWM slic...
Definition sg90.h:36
uint command_pin
the gpio pin used to command the servo motor. Correspond to the B channel of the PWM slice
Definition sg90.h:34
int pos_max_degree
maximum position in degrees. Typically 180° or +90°.
Definition sg90.h:40
int pos_min_degree
minimum position in degrees. Typically 0° or -90°.
Definition sg90.h:38