A simple stepper motor driver library, supporting micro-stepping drivers such as the Pololu A4988 stepper driver carrier or the Sparkfun EasyDriver.
Dependents: Robot2016_2-0_STATIC Robot2016_2-0
Fork of StepperMotor by
Stepper.h@1:e34729a7567f, 2016-04-05 (annotated)
- Committer:
- sype
- Date:
- Tue Apr 05 14:58:59 2016 +0000
- Revision:
- 1:e34729a7567f
- Parent:
- 0:52fb09e87581
- Child:
- 2:1cec7e9117f2
RAZ
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
melse | 0:52fb09e87581 | 1 | #ifndef MBED_STEPPER_H |
melse | 0:52fb09e87581 | 2 | #define MBED_STEPPER_H |
melse | 0:52fb09e87581 | 3 | #endif |
melse | 0:52fb09e87581 | 4 | |
melse | 0:52fb09e87581 | 5 | #include "mbed.h" |
melse | 0:52fb09e87581 | 6 | |
sype | 1:e34729a7567f | 7 | class Stepper |
melse | 0:52fb09e87581 | 8 | { |
melse | 0:52fb09e87581 | 9 | public: |
sype | 1:e34729a7567f | 10 | Stepper(PinName _en, PinName _stepPin, PinName dir); |
sype | 1:e34729a7567f | 11 | void step(int number, int dir, float speed); |
melse | 0:52fb09e87581 | 12 | void enable(); |
melse | 0:52fb09e87581 | 13 | void disable(); |
melse | 0:52fb09e87581 | 14 | private: |
melse | 0:52fb09e87581 | 15 | DigitalOut en; |
melse | 0:52fb09e87581 | 16 | DigitalOut stepPin; |
melse | 0:52fb09e87581 | 17 | DigitalOut direction; |
melse | 0:52fb09e87581 | 18 | }; |