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.h@1:3ca91ad8e927, 2018-12-14 (annotated)
- Committer:
- martinsimpson
- Date:
- Fri Dec 14 14:24:52 2018 +0000
- Revision:
- 1:3ca91ad8e927
- Parent:
- 0:51c12cc34baf
- Child:
- 2:bc41daf2b0ce
Version Alpha 0.1a
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| martinsimpson | 0:51c12cc34baf | 1 | #ifndef _MOTOR_H_ |
| martinsimpson | 0:51c12cc34baf | 2 | #define _MOTOR_H_ |
| martinsimpson | 0:51c12cc34baf | 3 | #include "mbed.h" |
| martinsimpson | 0:51c12cc34baf | 4 | class Motor |
| martinsimpson | 0:51c12cc34baf | 5 | { |
| martinsimpson | 0:51c12cc34baf | 6 | public: |
| martinsimpson | 1:3ca91ad8e927 | 7 | Motor(PinName pinName1, PinName pinName2, PinName pinName3, PinName pinName4); |
| martinsimpson | 0:51c12cc34baf | 8 | void Fwd(float time); |
| martinsimpson | 0:51c12cc34baf | 9 | void Rev(float time); |
| martinsimpson | 1:3ca91ad8e927 | 10 | void Stop(void); |
| martinsimpson | 1:3ca91ad8e927 | 11 | int Speed(float speedA, float speedB); |
| martinsimpson | 0:51c12cc34baf | 12 | void Period_in_ms(int msPeriod); |
| martinsimpson | 0:51c12cc34baf | 13 | private: |
| martinsimpson | 0:51c12cc34baf | 14 | PwmOut pin1; |
| martinsimpson | 0:51c12cc34baf | 15 | PwmOut pin2; |
| martinsimpson | 1:3ca91ad8e927 | 16 | PwmOut pin3; |
| martinsimpson | 1:3ca91ad8e927 | 17 | PwmOut pin4; |
| martinsimpson | 0:51c12cc34baf | 18 | }; |
| martinsimpson | 1:3ca91ad8e927 | 19 | |
| martinsimpson | 1:3ca91ad8e927 | 20 | //int motor(float speedA, float speedB); |
| martinsimpson | 1:3ca91ad8e927 | 21 | |
| martinsimpson | 0:51c12cc34baf | 22 | #endif |