C++ DevKit
C++ set of OOP library
sg90.h File Reference
#include "pico/stdlib.h"
#include "hw/pwm/hw_pwm.h"
Include dependency graph for sg90.h:

Go to the source code of this file.

Classes

struct  struct_ConfigSG90
 the data set that configures the SG90 motor More...
class  SG90
 the class that manages the SG90 step motor More...

Macros

#define STEP_ns   2000
 arbitrary value, gives resolution step_ns/(pos_max_us - pos_min_us) = 100ppm.
#define PHASE_CORRECT   false
 if PHASE_CORRECt = true, channel B is used as a synch pulse in the begining of channel A pulse else channel B is used as a synch pulse in the middle of channel A pulse.
#define PERIOD_us   20000
 20ms according to SG90 data sheet
#define T_MIN_us   500
 according to data sheet, should be 1000us but is 500us actually
#define T_MAX_us   2500
 according to data sheet, should be 2000us but is 2500us actually.

Detailed Description

Author
xiansnn (xians.nosp@m.nn@h.nosp@m.otmai.nosp@m.l.co.nosp@m.m)
Version
0.1
Date
2025-01-11