uStepper S
Public Member Functions | Private Attributes | List of all members
uStepperServo Class Reference

Prototype of class for ustepper servo. More...

#include <uStepperServo.h>

Collaboration diagram for uStepperServo:
Collaboration graph

Public Member Functions

void setup (void)
 
 uStepperServo ()
 Constructor for servo class. More...
 
void write (int angleArg)
 Specify angle of servo motor. More...
 
void setMinimumPulse (float us)
 Sets the minimum pulse. More...
 
void setMaximumPulse (float us)
 Sets the maximum pulse. More...
 

Private Attributes

uint8_t angle
 
uint16_t pulse
 
uint16_t min16
 
uint16_t max16
 

Detailed Description

Prototype of class for ustepper servo.

Definition at line 47 of file uStepperServo.h.

Constructor & Destructor Documentation

◆ uStepperServo()

uStepperServo::uStepperServo ( )

Constructor for servo class.

        This constructor is used to instantiate a new servo class,
        and should be used for each servo the user wishes to connect
        to the uStepper.

Definition at line 75 of file uStepperServo.cpp.

Member Function Documentation

◆ setMaximumPulse()

void uStepperServo::setMaximumPulse ( float  us)

Sets the maximum pulse.

        This method sets the maximum pulse length given to the servo
        motor. This pulse length defines the fully open angle.
Parameters
[in]tMaximum pulse width in microseconds

Definition at line 100 of file uStepperServo.cpp.

Here is the caller graph for this function:

◆ setMinimumPulse()

void uStepperServo::setMinimumPulse ( float  us)

Sets the minimum pulse.

        This method sets the minimum pulse length given to the servo
        motor. This pulse length defines the fully closed angle.
Parameters
[in]tMinimum pulse width in microseconds

Definition at line 95 of file uStepperServo.cpp.

Here is the caller graph for this function:

◆ setup()

void uStepperServo::setup ( void  )

Definition at line 80 of file uStepperServo.cpp.

Here is the call graph for this function:

◆ write()

void uStepperServo::write ( int  angleArg)

Specify angle of servo motor.

        This method sets an angle setpoint for the servo motor
Parameters
[in]angleArgThe angle argument

Definition at line 105 of file uStepperServo.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ angle

uint8_t uStepperServo::angle
private

Current angle in degrees

Definition at line 51 of file uStepperServo.h.

◆ max16

uint16_t uStepperServo::max16
private

Maximum pulse width in timer0 ticks (default = 150 = 2.4ms)

Definition at line 57 of file uStepperServo.h.

◆ min16

uint16_t uStepperServo::min16
private

Minimum pulse width in timer0 ticks (default = 92 = 1.472ms)

Definition at line 55 of file uStepperServo.h.

◆ pulse

uint16_t uStepperServo::pulse
private

Pulse width in timer0 ticks (1 tick = 16us)

Definition at line 53 of file uStepperServo.h.


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