![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
code for the speed robot
Dependencies: MPU6050-DMP mbed PololuQTRSensors vl53l0x
Diff: _var.h
- Revision:
- 0:c3a27228c31b
- Child:
- 1:b188e27eb7da
diff -r 000000000000 -r c3a27228c31b _var.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/_var.h Mon Sep 30 08:00:47 2019 +0000 @@ -0,0 +1,30 @@ +I2C i2c(PB_9,PB_8); + +// 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] \ No newline at end of file