13#include "pico/stdlib.h"
20#define PHASE_CORRECT false
22#define PERIOD_us 20000
61 float coef_us_per_degree;
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
SG90(struct_ConfigSG90 sg90_config)
Construct a new SG90 object.
Definition sg90.cpp:4
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