drive down
Dependencies: BMP280 BNO055_fusion PowerControl mbed
Fork of TEAM_G_FLOW_RIDA by
LOCOMOTION.h@15:7729da55873a, 2016-03-24 (annotated)
- Committer:
- 12104404
- Date:
- Thu Mar 24 07:20:51 2016 +0000
- Revision:
- 15:7729da55873a
- Parent:
- 6:0602a9e8118b
- Child:
- 16:d6f15a13c3aa
how to combine x y control
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
12104404 | 6:0602a9e8118b | 1 | #ifndef LOCOMOTION_H |
12104404 | 6:0602a9e8118b | 2 | #define LOCOMOTION_H |
12104404 | 6:0602a9e8118b | 3 | |
12104404 | 6:0602a9e8118b | 4 | #include "mbed.h" |
12104404 | 6:0602a9e8118b | 5 | |
12104404 | 15:7729da55873a | 6 | #define SPEED_TURN_MIN 0.15 |
12104404 | 15:7729da55873a | 7 | #define SPEED_TURN_MAX 0.35 |
12104404 | 15:7729da55873a | 8 | |
12104404 | 15:7729da55873a | 9 | enum { |
12104404 | 15:7729da55873a | 10 | ANGLE_TURN = 0, |
12104404 | 15:7729da55873a | 11 | ANGLE_BIAS = 1, |
12104404 | 15:7729da55873a | 12 | }; |
12104404 | 6:0602a9e8118b | 13 | |
12104404 | 6:0602a9e8118b | 14 | class LOCOMOTION |
12104404 | 6:0602a9e8118b | 15 | { |
12104404 | 6:0602a9e8118b | 16 | public: |
12104404 | 15:7729da55873a | 17 | LOCOMOTION(PinName motor1F, PinName motor1B,PinName motor2F, PinName motor2B, PinName forward1, PinName forward2); |
12104404 | 15:7729da55873a | 18 | PwmOut _m1f; |
12104404 | 15:7729da55873a | 19 | PwmOut _m1b; |
12104404 | 15:7729da55873a | 20 | PwmOut _m2f; |
12104404 | 15:7729da55873a | 21 | PwmOut _m2b; |
12104404 | 15:7729da55873a | 22 | DigitalOut _m1dir; |
12104404 | 15:7729da55873a | 23 | DigitalOut _m2dir; |
12104404 | 15:7729da55873a | 24 | bool setAngle(int target, int current, int error, int mode); |
12104404 | 15:7729da55873a | 25 | int wrap(int num); |
12104404 | 15:7729da55873a | 26 | |
12104404 | 15:7729da55873a | 27 | protected: |
12104404 | 15:7729da55873a | 28 | |
12104404 | 6:0602a9e8118b | 29 | }; |
12104404 | 6:0602a9e8118b | 30 | #endif |