C++ DevKit
C++ set of OOP library
SG90 Class Reference

the class that manages the SG90 step motor More...

#include <sg90.h>

Collaboration diagram for SG90:
Collaboration graph

Public Member Functions

 SG90 (struct_ConfigSG90 sg90_config)
 Construct a new SG90 object.
void set_pos (int pos)
 the command to set the position of the motor.

Private Attributes

PWM * pwm
 the PWM slice that handle the SG90 step motor device
uint command
 the gpio pin used to command the servo motor. Correspond to the B channel of the PWM slice
uint sync
 n auxilliary pulse that can be used as a synchro signal. Correspond to the A channel of the PWM slice
int pos_min_deg
 minimum position in degrees. Typically 0° or -90°.
int pos_max_deg
 maximum position in degrees. Typically 180° or +90°.
float coef_us_per_degree
 the coversion coefficient in microseconds per degree

Detailed Description

the class that manages the SG90 step motor

Constructor & Destructor Documentation

◆ SG90()

SG90::SG90 ( struct_ConfigSG90 sg90_config)

Construct a new SG90 object.

Parameters
sg90_config

Member Function Documentation

◆ set_pos()

void SG90::set_pos ( int pos)

the command to set the position of the motor.

Parameters
posposition in degrees, between pos_min_deg and pos_max_deg.

The documentation for this class was generated from the following files: