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@0:52fb09e87581, 2013-02-24 (annotated)
- Committer:
- melse
- Date:
- Sun Feb 24 16:23:02 2013 +0000
- Revision:
- 0:52fb09e87581
- Child:
- 1:e34729a7567f
Initial Commit
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 | |
melse | 0:52fb09e87581 | 7 | class stepper |
melse | 0:52fb09e87581 | 8 | { |
melse | 0:52fb09e87581 | 9 | public: |
melse | 0:52fb09e87581 | 10 | stepper(PinName _en, PinName ms1, PinName ms2, PinName ms3, PinName _stepPin, PinName dir); |
melse | 0:52fb09e87581 | 11 | void step(int microstep, 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 | BusOut microstepping; |
melse | 0:52fb09e87581 | 17 | DigitalOut stepPin; |
melse | 0:52fb09e87581 | 18 | DigitalOut direction; |
melse | 0:52fb09e87581 | 19 | }; |