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