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@1:c8f423bfe891, 2015-12-11 (annotated)
- Committer:
- sventura3
- Date:
- Fri Dec 11 15:50:02 2015 +0000
- Revision:
- 1:c8f423bfe891
- Parent:
- 0:a2a53dc49e0d
updated spelling error 2
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 | 1:c8f423bfe891 | 14 | DigitalOut stepPin; |
sventura3 | 1:c8f423bfe891 | 15 | DigitalOut direction; |
sventura3 | 0:a2a53dc49e0d | 16 | private: |
sventura3 | 0:a2a53dc49e0d | 17 | DigitalOut en; |
sventura3 | 0:a2a53dc49e0d | 18 | BusOut microstepping; |
sventura3 | 1:c8f423bfe891 | 19 | //DigitalOut stepPin; |
sventura3 | 1:c8f423bfe891 | 20 | //DigitalOut direction; |
sventura3 | 0:a2a53dc49e0d | 21 | }; |