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.
Motor/Motor.h@6:8d2171811f14, 2016-11-11 (annotated)
- Committer:
- dlweakley
- Date:
- Fri Nov 11 06:37:24 2016 +0000
- Revision:
- 6:8d2171811f14
- Child:
- 8:2abfdbf5a3b8
motor class
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dlweakley | 6:8d2171811f14 | 1 | #ifndef MBED_MOTOR_H |
dlweakley | 6:8d2171811f14 | 2 | #define MBED_MOTOR_H |
dlweakley | 6:8d2171811f14 | 3 | |
dlweakley | 6:8d2171811f14 | 4 | #include "mbed.h" |
dlweakley | 6:8d2171811f14 | 5 | |
dlweakley | 6:8d2171811f14 | 6 | class Motor { |
dlweakley | 6:8d2171811f14 | 7 | public: |
dlweakley | 6:8d2171811f14 | 8 | Motor(PinName _M1PWM, PinName _M2PWM, PinName _M1DIR, PinName _M2DIR, PinName _D2, int signal_wait = 0, int step_wait = 500); |
dlweakley | 6:8d2171811f14 | 9 | void clockwise(); |
dlweakley | 6:8d2171811f14 | 10 | void anticlockwise(); |
dlweakley | 6:8d2171811f14 | 11 | private: |
dlweakley | 6:8d2171811f14 | 12 | DigitalOut M1PWM; |
dlweakley | 6:8d2171811f14 | 13 | DigitalOut M2PWM; |
dlweakley | 6:8d2171811f14 | 14 | DigitalOut M1DIR; |
dlweakley | 6:8d2171811f14 | 15 | DigitalOut M2DIR; |
dlweakley | 6:8d2171811f14 | 16 | DigitalOut D2; |
dlweakley | 6:8d2171811f14 | 17 | |
dlweakley | 6:8d2171811f14 | 18 | int step_wait; |
dlweakley | 6:8d2171811f14 | 19 | int signal_wait; |
dlweakley | 6:8d2171811f14 | 20 | }; |
dlweakley | 6:8d2171811f14 | 21 | |
dlweakley | 6:8d2171811f14 | 22 | #endif |