DERPS

Dependencies:   BMP280 BNO055_fusion PowerControl mbed

Fork of STRAIGHT_DRIVE_NO_SEP by Antoine Laurens

Committer:
12104404
Date:
Sun Apr 03 05:48:37 2016 +0000
Revision:
19:2dd81b864e14
Parent:
18:f9012e93edb8
Child:
23:455f7da3dd7a
Cleaning up code;

Who changed what in which revision?

UserRevisionLine numberNew 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 15:7729da55873a 18 LOCOMOTION(PinName motor1F, PinName motor1B,PinName motor2F, PinName motor2B, PinName forward1, PinName forward2);
12104404 15:7729da55873a 19 PwmOut _m1f;
12104404 15:7729da55873a 20 PwmOut _m1b;
12104404 15:7729da55873a 21 PwmOut _m2f;
12104404 15:7729da55873a 22 PwmOut _m2b;
12104404 15:7729da55873a 23 DigitalOut _m1dir;
12104404 15:7729da55873a 24 DigitalOut _m2dir;
12104404 18:f9012e93edb8 25 bool setXPos(int target, int current, int error, int angle);
12104404 18:f9012e93edb8 26 bool setYPos(int target, int current, int error, int angle);
12104404 15:7729da55873a 27 bool setAngle(int target, int current, int error, int mode);
12104404 19:2dd81b864e14 28 void stopMotors(void);
12104404 19:2dd81b864e14 29 inline int wrap(int num);
12104404 15:7729da55873a 30
12104404 15:7729da55873a 31 protected:
12104404 17:2f89826b5679 32 float s;
12104404 19:2dd81b864e14 33
12104404 6:0602a9e8118b 34 };
12104404 6:0602a9e8118b 35 #endif