PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
4-pin bipolar and 5-pin unipolar stepper motor driver More...
#include <PropWare/motor/stepper.h>
Public Types | |
enum | Step { HALF, ONE, ONE_AND_A_HALF, TWO, TWO_AND_A_HALF, THREE, THREE_AND_A_HALF, FOUR } |
Public Member Functions | |
Stepper (const Pin::Mask phase1Mask, const Pin::Mask phase2Mask, const Pin::Mask phase3Mask, const Pin::Mask phase4Mask, const Step start=DEFAULT_START_STEP) | |
Constructor. More... | |
void | step_to (const Stepper::Step step) |
Move the motor directly to the specified step. More... | |
Step | get_current_step () const |
Get the current step. More... | |
bool | full_power_hold (const bool direction, const unsigned int usDelay=DEFAULT_DELAY) |
Step the motor to the nearest half-step to achieve a full-power hold. More... | |
bool | half_power_hold (const bool direction, const unsigned int usDelay=DEFAULT_DELAY) |
Step the motor to the nearest full-step to achieve a half-power hold. More... | |
void | step_forward (unsigned int steps, const unsigned int usDelay=DEFAULT_DELAY) |
Move the motor forward by a specified number of steps. More... | |
void | half_forward (unsigned int halfSteps, const unsigned int usDelay=DEFAULT_DELAY) |
Move the motor forward the a specified number of half-steps. More... | |
void | step_reverse (unsigned int steps, const unsigned int usDelay=DEFAULT_DELAY) |
Move the motor backward by a specified number of steps. More... | |
void | half_reverse (unsigned int halfSteps, const unsigned int usDelay=DEFAULT_DELAY) |
Move the motor backward by a specified number of half-steps. More... | |
Static Public Attributes | |
static const unsigned int | DEFAULT_DELAY = 10000 |
Default delay in microseconds used between each step. | |
static const Step | DEFAULT_START_STEP = Step::HALF |
4-pin bipolar and 5-pin unipolar stepper motor driver
bool PropWare::Stepper::full_power_hold | ( | const bool | direction, |
const unsigned int | usDelay = DEFAULT_DELAY |
||
) |
Step the motor to the nearest half-step to achieve a full-power hold.
direction[in] | True for forward, false for backward |
usDelay | Delay in microseconds after the step is taken (must be greater than 17 for lmm) |
Definition at line 101 of file stepper.h.
Step PropWare::Stepper::get_current_step | ( | ) | const |
void PropWare::Stepper::half_forward | ( | unsigned int | halfSteps, |
const unsigned int | usDelay = DEFAULT_DELAY |
||
) |
bool PropWare::Stepper::half_power_hold | ( | const bool | direction, |
const unsigned int | usDelay = DEFAULT_DELAY |
||
) |
Step the motor to the nearest full-step to achieve a half-power hold.
direction[in] | True for forward, false for backward |
usDelay | Delay in microseconds after the step is taken (must be greater than 17 for lmm) |
Definition at line 121 of file stepper.h.
void PropWare::Stepper::half_reverse | ( | unsigned int | halfSteps, |
const unsigned int | usDelay = DEFAULT_DELAY |
||
) |
void PropWare::Stepper::step_forward | ( | unsigned int | steps, |
const unsigned int | usDelay = DEFAULT_DELAY |
||
) |
void PropWare::Stepper::step_reverse | ( | unsigned int | steps, |
const unsigned int | usDelay = DEFAULT_DELAY |
||
) |
void PropWare::Stepper::step_to | ( | const Stepper::Step | step | ) |