Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
AsyncStepper Class Reference
Drive a stepper motor using A4988 with asynchronous. More...
#include <AsyncStepper.hpp>
Public Member Functions | |
| AsyncStepper (PinName enablePin, PinName stepPin, PinName dirPin, uint32_t rpm, stepMode_e stepMode=FULL, PinName ms1Pin=NC, PinName ms2Pin=NC, PinName ms3Pin=NC, uint32_t oneRotationFullSteps=200, stopMode_e stopMode=FREE) | |
| Create a new AsyncStepper port. | |
| virtual | ~AsyncStepper () |
| Destrutor of AsyncStepper. | |
| virtual void | SetRPM (uint32_t rpm) |
| Set RPM of the stepper motor. | |
| virtual void | SetStepMode (stepMode_e stepMode) |
| Set division ratio of the stepper motor. | |
| virtual void | Enable (void) |
| Apply the current to the stepper motor. | |
| virtual void | Disable (void) |
| Stop the current to the stepper motor. | |
| virtual bool | IsStopping (void) |
| Check the stepper motor stopping. | |
| virtual void | Rotate (direction_e direction, uint32_t steps) |
| Rotate the stepper motor. | |
Detailed Description
Drive a stepper motor using A4988 with asynchronous.
Definition at line 47 of file AsyncStepper.hpp.
Constructor & Destructor Documentation
| AsyncStepper | ( | PinName | enablePin, |
| PinName | stepPin, | ||
| PinName | dirPin, | ||
| uint32_t | rpm, | ||
| stepMode_e | stepMode = FULL, |
||
| PinName | ms1Pin = NC, |
||
| PinName | ms2Pin = NC, |
||
| PinName | ms3Pin = NC, |
||
| uint32_t | oneRotationFullSteps = 200, |
||
| stopMode_e | stopMode = FREE |
||
| ) |
Create a new AsyncStepper port.
- Parameters:
-
enablePin A4988 Enable pin stepPin A4988 Step pin dirPin A4988 Direction pin rpm RPM stepMode Division ratio ms1Pin A4988 MS1 ms2Pin A4988 MS2 ms3Pin A4988 MS1 oneRotationFullSteps Steps per rotation of your stepper motor stopMode Enable/Disable holding torque
Definition at line 17 of file AsyncStepper.cpp.
| ~AsyncStepper | ( | ) | [virtual] |
Destrutor of AsyncStepper.
Definition at line 36 of file AsyncStepper.cpp.
Member Function Documentation
| void Disable | ( | void | ) | [virtual] |
Stop the current to the stepper motor.
Definition at line 96 of file AsyncStepper.cpp.
| void Enable | ( | void | ) | [virtual] |
Apply the current to the stepper motor.
Definition at line 89 of file AsyncStepper.cpp.
| bool IsStopping | ( | void | ) | [virtual] |
Check the stepper motor stopping.
- Return values:
-
true Yes (Stopping) false No
Definition at line 103 of file AsyncStepper.cpp.
| void Rotate | ( | direction_e | direction, |
| uint32_t | steps | ||
| ) | [virtual] |
Rotate the stepper motor.
- Parameters:
-
direction POSITIVE or NEGATIVE steps Steps of rotation
Definition at line 108 of file AsyncStepper.cpp.
| void SetRPM | ( | uint32_t | rpm ) | [virtual] |
| void SetStepMode | ( | stepMode_e | stepMode ) | [virtual] |
Set division ratio of the stepper motor.
- Parameters:
-
stepMode division ratio
Definition at line 80 of file AsyncStepper.cpp.
Generated on Wed Jul 13 2022 02:34:47 by
1.7.2