![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
added
Dependencies: BNO055_fusion PowerControl mbed
Fork of TEAM_G_FLOW_RIDA by
LOCOMOTION.h@23:455f7da3dd7a, 2016-04-03 (annotated)
- Committer:
- 12104404
- Date:
- Sun Apr 03 07:08:18 2016 +0000
- Revision:
- 23:455f7da3dd7a
- Parent:
- 19:2dd81b864e14
- Child:
- 24:fb1f083ebd62
Brown Out and LED calling fixed
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 | 17:2f89826b5679 | 5 | #include "LOCALIZE.h" |
12104404 | 6:0602a9e8118b | 6 | |
12104404 | 16:d6f15a13c3aa | 7 | #define SPEED_TURN_MIN 0.20 |
12104404 | 16:d6f15a13c3aa | 8 | #define SPEED_TURN_MAX 0.65 |
12104404 | 15:7729da55873a | 9 | |
12104404 | 15:7729da55873a | 10 | enum { |
12104404 | 15:7729da55873a | 11 | ANGLE_TURN = 0, |
12104404 | 15:7729da55873a | 12 | ANGLE_BIAS = 1, |
12104404 | 15:7729da55873a | 13 | }; |
12104404 | 6:0602a9e8118b | 14 | |
12104404 | 6:0602a9e8118b | 15 | class LOCOMOTION |
12104404 | 6:0602a9e8118b | 16 | { |
12104404 | 6:0602a9e8118b | 17 | public: |
12104404 | 23:455f7da3dd7a | 18 | LOCOMOTION(PinName en, PinName motor1F, PinName motor1B,PinName motor2F, PinName motor2B, PinName forward1, PinName forward2); |
12104404 | 23:455f7da3dd7a | 19 | DigitalOut _en; |
12104404 | 15:7729da55873a | 20 | PwmOut _m1f; |
12104404 | 15:7729da55873a | 21 | PwmOut _m1b; |
12104404 | 15:7729da55873a | 22 | PwmOut _m2f; |
12104404 | 15:7729da55873a | 23 | PwmOut _m2b; |
12104404 | 15:7729da55873a | 24 | DigitalOut _m1dir; |
12104404 | 15:7729da55873a | 25 | DigitalOut _m2dir; |
12104404 | 23:455f7da3dd7a | 26 | void eStop(void); |
12104404 | 18:f9012e93edb8 | 27 | bool setXPos(int target, int current, int error, int angle); |
12104404 | 18:f9012e93edb8 | 28 | bool setYPos(int target, int current, int error, int angle); |
12104404 | 15:7729da55873a | 29 | bool setAngle(int target, int current, int error, int mode); |
12104404 | 15:7729da55873a | 30 | |
12104404 | 15:7729da55873a | 31 | protected: |
12104404 | 17:2f89826b5679 | 32 | float s; |
12104404 | 23:455f7da3dd7a | 33 | void stopMotors(void); |
12104404 | 23:455f7da3dd7a | 34 | int wrap(int num); |
12104404 | 19:2dd81b864e14 | 35 | |
12104404 | 6:0602a9e8118b | 36 | }; |
12104404 | 6:0602a9e8118b | 37 | #endif |