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@8:2abfdbf5a3b8, 2016-11-11 (annotated)
- Committer:
- dlweakley
- Date:
- Fri Nov 11 21:19:06 2016 +0000
- Revision:
- 8:2abfdbf5a3b8
- Parent:
- 6:8d2171811f14
- Child:
- 22:c18f04d1dc49
test methods and angle 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 | 8:2abfdbf5a3b8 | 8 | Motor(PinName _M1PWM, PinName _M2PWM, PinName _M1DIR, PinName _M2DIR, PinName _D2, int default_wait); |
dlweakley | 6:8d2171811f14 | 9 | void clockwise(); |
dlweakley | 6:8d2171811f14 | 10 | void anticlockwise(); |
dlweakley | 8:2abfdbf5a3b8 | 11 | void clockwise(int wait); |
dlweakley | 8:2abfdbf5a3b8 | 12 | void anticlockwise(int wait); |
dlweakley | 8:2abfdbf5a3b8 | 13 | void step_clockwise(int steps); |
dlweakley | 8:2abfdbf5a3b8 | 14 | void step_anticlockwise(int steps); |
dlweakley | 8:2abfdbf5a3b8 | 15 | void step_anticlockwise(int steps, int wait); |
dlweakley | 8:2abfdbf5a3b8 | 16 | void step_clockwise(int steps, int wait); |
dlweakley | 6:8d2171811f14 | 17 | private: |
dlweakley | 6:8d2171811f14 | 18 | DigitalOut M1PWM; |
dlweakley | 6:8d2171811f14 | 19 | DigitalOut M2PWM; |
dlweakley | 6:8d2171811f14 | 20 | DigitalOut M1DIR; |
dlweakley | 6:8d2171811f14 | 21 | DigitalOut M2DIR; |
dlweakley | 6:8d2171811f14 | 22 | DigitalOut D2; |
dlweakley | 6:8d2171811f14 | 23 | |
dlweakley | 8:2abfdbf5a3b8 | 24 | int default_wait; |
dlweakley | 6:8d2171811f14 | 25 | }; |
dlweakley | 6:8d2171811f14 | 26 | |
dlweakley | 6:8d2171811f14 | 27 | #endif |