Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of ESE519_Lab6_part3_skeleton by
Diff: BroBot_IMU.h
- Revision:
- 4:2512939c10f0
- Parent:
- 3:2f76ffbc5cef
--- a/BroBot_IMU.h Wed Oct 12 05:04:10 2016 +0000
+++ b/BroBot_IMU.h Tue Oct 18 20:44:21 2016 +0000
@@ -1,7 +1,8 @@
//BroBot_IMU.h
// Contains everyting needed to interface with the IMU for BroBot
-
-#define ANGLE_OFFSET 105
+//Source links: https: developer.mbed.org/users/Sissors/code/MPU6050/docs/5c63e20c50f3/classMPU6050.html
+// https://developer.mbed.org/users/paulbartell/code/MPU6050-DMP/file/95449a48c5c0/MPU6050_6Axis_MotionApps20.h
+#define ANGLE_OFFSET 107
// class default I2C address is 0x68
// specific I2C addresses may be passed as a parameter here
@@ -18,7 +19,8 @@
uint16_t packetSize; // expected DMP packet size (default is 42 bytes)
uint16_t fifoCount; // count of all bytes currently in FIFO
uint8_t fifoBuffer[64]; // FIFO storage buffer
-
+float dAngle;
+float new_angle;
// Orientation/motion vars
Quaternion q; // [w, x, y, z] quaternion container
@@ -58,6 +60,7 @@
// === INTERRUPT DETECTION ROUTINE ===
// ================================================================
volatile bool mpuInterrupt = false; // indicates whether MPU interrupt pin has gone high
+Serial pc1(USBTX, USBRX);
void dmpDataReady()
{
mpuInterrupt = true;
