Treehopper C# API
HobbyServo Class Reference

The HobbyServo library is used to control small DC servos that use pulse-width control. More...

Inheritance diagram for HobbyServo:

Public Member Functions

 HobbyServo (Pwm pwm, double minPulseWidth=500, double maxPulseWidth=2500)
 Construct a hobby servo motor More...
 
void Dispose ()
 

Properties

double MinPulseWidth [get, set]
 Gets or sets the minimum pulse width for the motor More...
 
double MaxPulseWidth [get, set]
 Gets or sets the max pulse width of the motor More...
 
double Angle [get, set]
 Gets or sets the angle of the servo More...
 

Detailed Description

The HobbyServo library is used to control small DC servos that use pulse-width control.

Constructor & Destructor Documentation

◆ HobbyServo()

HobbyServo ( Pwm  pwm,
double  minPulseWidth = 500,
double  maxPulseWidth = 2500 
)

Construct a hobby servo motor

Parameters
pwmThe PWM module to use
minPulseWidthThe minimum pulse width, in microseconds, corresponding to 0-degree angle
maxPulseWidthThe maximum pulse width, in microseconds, corresponding to 180-degree angle

Member Function Documentation

◆ Dispose()

void Dispose ( )

Property Documentation

◆ MinPulseWidth

double MinPulseWidth
getset

Gets or sets the minimum pulse width for the motor

◆ MaxPulseWidth

double MaxPulseWidth
getset

Gets or sets the max pulse width of the motor

◆ Angle

double Angle
getset

Gets or sets the angle of the servo


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