code for the speed robot

Dependencies:   MPU6050-DMP mbed PololuQTRSensors vl53l0x

_var.h

Committer:
deepanaishtaweera174
Date:
2019-09-30
Revision:
1:b188e27eb7da
Parent:
0:c3a27228c31b
Child:
3:9b2f15b0d47b

File content as of revision 1:b188e27eb7da:

I2C i2c(PB_9,PB_8);
Timer t;
VL53L0X sensorFront(&i2c,&t);
float frontDistance;

// Gyro Variables
MPU6050 mpu;
volatile bool mpuInterrupt = false;
unsigned long savedMillis;
bool gyroTurnMode = false;
float zAngle = 0;
float xAngle = 0;
float preZAngle = 0;
float preXAngle = 0;
float startAngle = 0;
unsigned long preGyroMillis = 0;

// MPU control/status vars
bool dmpReady = false; // set true if DMP init was successful
uint8_t mpuIntStatus;  // holds actual interrupt status byte from MPU
uint8_t devStatus;
uint16_t packetSize; // expected DMP packet size (default is 42 bytes)
uint16_t fifoCount;
uint8_t fifoBuffer[64];

// orientation/motion vars
Quaternion q;        // [w, x, y, z]         quaternion container
VectorInt16 aa;      // [x, y, z]            accel sensor measurements
VectorInt16 aaReal;  // [x, y, z]
VectorInt16 aaWorld; // [x, y, z]
VectorFloat gravity; // [x, y, z]            gravity vector
float euler[3];      // [psi, theta, phi]    Euler angle container
float ypr[3];        // [yaw, pitch, roll]