![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
my new gear...
actuator/DCmotor.hpp@22:394337a4205a, 22 months ago (annotated)
- Committer:
- yootee
- Date:
- Sat Oct 15 07:52:25 2022 +0000
- Revision:
- 22:394337a4205a
- Parent:
- 2:e7b09385d197
upgrade
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yootee | 2:e7b09385d197 | 1 | #pragma once |
yootee | 2:e7b09385d197 | 2 | #include<mbed.h> |
yootee | 2:e7b09385d197 | 3 | #include<portSet.hpp> |
yootee | 2:e7b09385d197 | 4 | |
yootee | 2:e7b09385d197 | 5 | class DCmotor |
yootee | 2:e7b09385d197 | 6 | { |
yootee | 2:e7b09385d197 | 7 | public: |
yootee | 2:e7b09385d197 | 8 | DCmotor(Port motor, float max_pwm, float min_pwm, bool CW_flag); |
yootee | 2:e7b09385d197 | 9 | DCmotor(PinName pin_a, PinName pin_b, float max_pwm, float min_pwm, bool CW_flag); |
yootee | 2:e7b09385d197 | 10 | void drive(float pwm); |
yootee | 2:e7b09385d197 | 11 | private: |
yootee | 2:e7b09385d197 | 12 | Port motor_; |
yootee | 2:e7b09385d197 | 13 | float max_pwm_; |
yootee | 2:e7b09385d197 | 14 | float min_pwm_; |
yootee | 2:e7b09385d197 | 15 | bool CW_flag_; |
yootee | 2:e7b09385d197 | 16 | }; |