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@22:c18f04d1dc49, 2016-11-18 (annotated)
- Committer:
- dlweakley
- Date:
- Fri Nov 18 02:47:59 2016 +0000
- Revision:
- 22:c18f04d1dc49
- Parent:
- 8:2abfdbf5a3b8
- Child:
- 23:5238b046119b
PID attempt
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 | 22:c18f04d1dc49 | 16 | void step_clockwise(int steps, int wait); |
dlweakley | 22:c18f04d1dc49 | 17 | void run (bool t); |
dlweakley | 22:c18f04d1dc49 | 18 | |
dlweakley | 22:c18f04d1dc49 | 19 | int wait; |
dlweakley | 22:c18f04d1dc49 | 20 | bool dir; |
dlweakley | 6:8d2171811f14 | 21 | private: |
dlweakley | 6:8d2171811f14 | 22 | DigitalOut M1PWM; |
dlweakley | 6:8d2171811f14 | 23 | DigitalOut M2PWM; |
dlweakley | 6:8d2171811f14 | 24 | DigitalOut M1DIR; |
dlweakley | 6:8d2171811f14 | 25 | DigitalOut M2DIR; |
dlweakley | 6:8d2171811f14 | 26 | DigitalOut D2; |
dlweakley | 6:8d2171811f14 | 27 | |
dlweakley | 22:c18f04d1dc49 | 28 | |
dlweakley | 6:8d2171811f14 | 29 | }; |
dlweakley | 6:8d2171811f14 | 30 | |
dlweakley | 6:8d2171811f14 | 31 | #endif |