Library for rolling motor
Motor_lib.h@0:e492422d50a7, 2020-03-17 (annotated)
- Committer:
- Sigma884
- Date:
- Tue Mar 17 12:30:18 2020 +0000
- Revision:
- 0:e492422d50a7
commit for publish stability_seed2019_v1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Sigma884 | 0:e492422d50a7 | 1 | #ifndef MOTOR_LIB_H |
Sigma884 | 0:e492422d50a7 | 2 | #define MOTOR_LIB_H |
Sigma884 | 0:e492422d50a7 | 3 | |
Sigma884 | 0:e492422d50a7 | 4 | #include "mbed.h" |
Sigma884 | 0:e492422d50a7 | 5 | |
Sigma884 | 0:e492422d50a7 | 6 | class Motor_lib{ |
Sigma884 | 0:e492422d50a7 | 7 | |
Sigma884 | 0:e492422d50a7 | 8 | public: |
Sigma884 | 0:e492422d50a7 | 9 | Motor_lib(PinName pin1, PinName pin2); |
Sigma884 | 0:e492422d50a7 | 10 | float status; |
Sigma884 | 0:e492422d50a7 | 11 | private: |
Sigma884 | 0:e492422d50a7 | 12 | PwmOut out1; |
Sigma884 | 0:e492422d50a7 | 13 | PwmOut out2; |
Sigma884 | 0:e492422d50a7 | 14 | Motor_lib *mlib; |
Sigma884 | 0:e492422d50a7 | 15 | Timeout stopTime; |
Sigma884 | 0:e492422d50a7 | 16 | |
Sigma884 | 0:e492422d50a7 | 17 | public: |
Sigma884 | 0:e492422d50a7 | 18 | void turn_a(); |
Sigma884 | 0:e492422d50a7 | 19 | void turn_a(float power); |
Sigma884 | 0:e492422d50a7 | 20 | void turn_b(); |
Sigma884 | 0:e492422d50a7 | 21 | void turn_b(float power); |
Sigma884 | 0:e492422d50a7 | 22 | void stop(); |
Sigma884 | 0:e492422d50a7 | 23 | void break_stop(float time); |
Sigma884 | 0:e492422d50a7 | 24 | void break_stop(); |
Sigma884 | 0:e492422d50a7 | 25 | }; |
Sigma884 | 0:e492422d50a7 | 26 | |
Sigma884 | 0:e492422d50a7 | 27 | #endif |