uStepper
|
Prototype of class for ustepper servo. More...
#include <uStepperServo.h>
Public Member Functions | |
uStepperServo () | |
Constructor for servo class. More... | |
uint8_t | attach (int pinArg) |
Attaches the servo motor to a specific pin. More... | |
void | detach () |
Detaches the servo motor from the uStepper. More... | |
void | write (int angleArg) |
Specify angle of servo motor. More... | |
void | setMinimumPulse (uint16_t t) |
Sets the minimum pulse. More... | |
void | setMaximumPulse (uint16_t t) |
Sets the maximum pulse. More... | |
Static Public Member Functions | |
static void | refresh () |
Updates servo output pins. More... | |
Private Attributes | |
uint8_t | pin |
uint8_t | angle |
uint16_t | pulse |
uint8_t | min16 |
uint8_t | max16 |
class uStepperServo * | next |
Static Private Attributes | |
static uStepperServo * | first |
Prototype of class for ustepper servo.
Definition at line 44 of file uStepperServo.h.
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 103 of file uStepperServo.cpp.
uint8_t uStepperServo::attach | ( | int | pinArg | ) |
Attaches the servo motor to a specific pin.
This method is used to attach the instantiated servo motor object to a specific pin connected to the servo input terminal
[in] | pinArg | Pin connected to servo input terminal |
Definition at line 118 of file uStepperServo.cpp.
void uStepperServo::detach | ( | ) |
Detaches the servo motor from the uStepper.
This method detaches the servo motor from the uStepper
Definition at line 130 of file uStepperServo.cpp.
|
static |
Updates servo output pins.
This method updates the pulses on the servo output pins. This method must be called at least once every 50 ms, to ensure correct movement of the Servo motors!
Definition at line 152 of file uStepperServo.cpp.
void uStepperServo::setMaximumPulse | ( | uint16_t | t | ) |
Sets the maximum pulse.
This method sets the maximum pulse length given to the servo motor. This pulse length defines the fully open angle.
[in] | t | Maximum pulse width in microseconds |
Definition at line 113 of file uStepperServo.cpp.
void uStepperServo::setMinimumPulse | ( | uint16_t | t | ) |
Sets the minimum pulse.
This method sets the minimum pulse length given to the servo motor. This pulse length defines the fully closed angle.
[in] | t | Minimum pulse width in microseconds |
Definition at line 108 of file uStepperServo.cpp.
void uStepperServo::write | ( | int | angleArg | ) |
Specify angle of servo motor.
This method sets an angle setpoint for the servo motor
[in] | angleArg | The angle argument |
Definition at line 141 of file uStepperServo.cpp.
|
private |
Current angle in degrees
Definition at line 50 of file uStepperServo.h.
|
staticprivate |
Pointer to hold address of first servo in chain
Definition at line 63 of file uStepperServo.h.
|
private |
Maximum pulse width in timer0 ticks (default = 150 = 2.4ms)
Definition at line 56 of file uStepperServo.h.
|
private |
Minimum pulse width in timer0 ticks (default = 92 = 1.472ms)
Definition at line 54 of file uStepperServo.h.
|
private |
Pointer to hold address of next servo in chain, if multiple servos are connected
Definition at line 60 of file uStepperServo.h.
|
private |
Digital output pin connected to servo input terminal
Definition at line 48 of file uStepperServo.h.
|
private |
Pulse width in timer0 ticks (1 tick = 16us)
Definition at line 52 of file uStepperServo.h.