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.
inc/Motor.h@0:ba536a24c5ad, 2019-11-06 (annotated)
- Committer:
- yeongsookim
- Date:
- Wed Nov 06 01:18:47 2019 +0000
- Revision:
- 0:ba536a24c5ad
First commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| yeongsookim | 0:ba536a24c5ad | 1 | #ifndef MBED_MOTOR_H |
| yeongsookim | 0:ba536a24c5ad | 2 | #define MBED_MOTOR_H |
| yeongsookim | 0:ba536a24c5ad | 3 | |
| yeongsookim | 0:ba536a24c5ad | 4 | #include "mbed.h" |
| yeongsookim | 0:ba536a24c5ad | 5 | |
| yeongsookim | 0:ba536a24c5ad | 6 | #define FORWARD 'f' |
| yeongsookim | 0:ba536a24c5ad | 7 | #define BACKWARD 'b' |
| yeongsookim | 0:ba536a24c5ad | 8 | #define BREAK 's' |
| yeongsookim | 0:ba536a24c5ad | 9 | |
| yeongsookim | 0:ba536a24c5ad | 10 | class Motor |
| yeongsookim | 0:ba536a24c5ad | 11 | { |
| yeongsookim | 0:ba536a24c5ad | 12 | private: |
| yeongsookim | 0:ba536a24c5ad | 13 | PwmOut IN1_, IN2_; |
| yeongsookim | 0:ba536a24c5ad | 14 | DigitalOut INH1_, INH2_; |
| yeongsookim | 0:ba536a24c5ad | 15 | |
| yeongsookim | 0:ba536a24c5ad | 16 | public: |
| yeongsookim | 0:ba536a24c5ad | 17 | Motor(PinName IN1, PinName IN2,PinName INH1, PinName INH2); |
| yeongsookim | 0:ba536a24c5ad | 18 | |
| yeongsookim | 0:ba536a24c5ad | 19 | void setSpeed_percent(float percent, char direction); |
| yeongsookim | 0:ba536a24c5ad | 20 | }; |
| yeongsookim | 0:ba536a24c5ad | 21 | |
| yeongsookim | 0:ba536a24c5ad | 22 | #endif |