Fully functional driver for the DRV88255 stepper motor driver. Includes microstepping, speed, disable and enable.
Dependents: Lidar_2D_Mapping Water Play Water_pump Lidar_2D_Mapping
DRV8825.h@0:a2a53dc49e0d, 2015-12-10 (annotated)
- Committer:
- sventura3
- Date:
- Thu Dec 10 03:26:03 2015 +0000
- Revision:
- 0:a2a53dc49e0d
- Child:
- 1:c8f423bfe891
fully functional
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sventura3 | 0:a2a53dc49e0d | 1 | #ifndef MBED_DRV8825_H |
sventura3 | 0:a2a53dc49e0d | 2 | #define MBED_DRV8825_H |
sventura3 | 0:a2a53dc49e0d | 3 | #endif |
sventura3 | 0:a2a53dc49e0d | 4 | |
sventura3 | 0:a2a53dc49e0d | 5 | #include "mbed.h" |
sventura3 | 0:a2a53dc49e0d | 6 | |
sventura3 | 0:a2a53dc49e0d | 7 | class DRV8825 |
sventura3 | 0:a2a53dc49e0d | 8 | { |
sventura3 | 0:a2a53dc49e0d | 9 | public: |
sventura3 | 0:a2a53dc49e0d | 10 | DRV8825(PinName _en, PinName m0, PinName m1, PinName m2, PinName _stepPin, PinName dir); |
sventura3 | 0:a2a53dc49e0d | 11 | void settings(float microstep, int dir, float speed); |
sventura3 | 0:a2a53dc49e0d | 12 | void enable(); |
sventura3 | 0:a2a53dc49e0d | 13 | void disable(); |
sventura3 | 0:a2a53dc49e0d | 14 | private: |
sventura3 | 0:a2a53dc49e0d | 15 | DigitalOut en; |
sventura3 | 0:a2a53dc49e0d | 16 | BusOut microstepping; |
sventura3 | 0:a2a53dc49e0d | 17 | DigitalOut stepPin; |
sventura3 | 0:a2a53dc49e0d | 18 | DigitalOut direction; |
sventura3 | 0:a2a53dc49e0d | 19 | }; |