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.
headers/motors.h@0:88c60458332e, 2018-11-08 (annotated)
- Committer:
- rwgriffithv
- Date:
- Thu Nov 08 06:38:19 2018 +0000
- Revision:
- 0:88c60458332e
- Child:
- 3:35deb5c21b33
initial commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| rwgriffithv | 0:88c60458332e | 1 | #pragma once |
| rwgriffithv | 0:88c60458332e | 2 | |
| rwgriffithv | 0:88c60458332e | 3 | const int PERIOD_US = 10000; |
| rwgriffithv | 0:88c60458332e | 4 | |
| rwgriffithv | 0:88c60458332e | 5 | // Feel free to change these parameters as needed |
| rwgriffithv | 0:88c60458332e | 6 | const float MIN_SPEED = 0.08f; |
| rwgriffithv | 0:88c60458332e | 7 | const float MAX_SPEED = 0.3f; |
| rwgriffithv | 0:88c60458332e | 8 | |
| rwgriffithv | 0:88c60458332e | 9 | const int RIGHT_MOTOR = 0; |
| rwgriffithv | 0:88c60458332e | 10 | const int LEFT_MOTOR = 1; |
| rwgriffithv | 0:88c60458332e | 11 | |
| rwgriffithv | 0:88c60458332e | 12 | class Motors { |
| rwgriffithv | 0:88c60458332e | 13 | public: |
| rwgriffithv | 0:88c60458332e | 14 | Motors(); |
| rwgriffithv | 0:88c60458332e | 15 | void startBaseSpeed(); |
| rwgriffithv | 0:88c60458332e | 16 | void stop(); |
| rwgriffithv | 0:88c60458332e | 17 | |
| rwgriffithv | 0:88c60458332e | 18 | /*** |
| rwgriffithv | 0:88c60458332e | 19 | * Range from 0.0-1.0. |
| rwgriffithv | 0:88c60458332e | 20 | ***/ |
| rwgriffithv | 0:88c60458332e | 21 | void setLeftPwm(float pwm); |
| rwgriffithv | 0:88c60458332e | 22 | void setRightPwm(float pwm); |
| rwgriffithv | 0:88c60458332e | 23 | private: |
| rwgriffithv | 0:88c60458332e | 24 | void setMotorPwm(int motor, float pwm); |
| rwgriffithv | 0:88c60458332e | 25 | |
| rwgriffithv | 0:88c60458332e | 26 | float m_rpwm; |
| rwgriffithv | 0:88c60458332e | 27 | float m_lpwm; |
| rwgriffithv | 0:88c60458332e | 28 | }; |
