MPU6050 Gyro Using Jeff Rowberg's code not working!

Trying to get an MPU6050 to display angles in serial monitor, not working.
Using Jeff Rowberg's code.
Here is serial for raw values:

Testing device connections...
MPU6050 connection failed
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0
a/g: 0 0 0 0 0 0

and on and on and on... Just ZEROES!

Here is serial for DMP6

Initializing I2C devices...
Testing device connections...
MPU6050 connection failed

Send any character to begin DMP programming and demo:
Initializing DMP...
DMP Initialization failed (code 1)

My wiring (connected to Mega2560)

Vcc to 5V
Gnd to Gnd
Int to Digital 2
Scl to A5
Sda to A4

Lots of research on this problem done, tried everything!
Help is very much appreciated.

Thank you!

Well

MPU6050 connection failed
...
DMP Initialization failed (code 1)

Is the first thing you need to fix...

Which Breakout board do you have?

Thanks for quick reply,

I believe its a GY521 breakout board.

Thanks!

For the Mega:

TWI: 20 (SDA) and 21 (SCL). Support TWI communication using the Wire library. 
Note that these pins are not in the same location as the TWI pins on the old Duemilanove or Diecimila Arduino boards.

A4 and A5 are for Uno, Nano and such

Jacques

Thanks!

Now Serial is:
Initializing I2C devices...
Testing device connections...
MPU6050 connection successful

Send any character to begin DMP programming and demo:
Initializing DMP...
Enabling DMP...
Enabling interrupt detection (Arduino external interrupt 0)...
DMP ready! Waiting for first interrupt...
quat 0.80 -0.08 0.59 -0.01
quat -0.03 0.07 -1.21 0.10
quat -0.60 -0.69 0.43 -1.21
quat -0.01 -0.00 0.00 -0.00
quat -1.72 0.92 -0.12 -0.75
quat 1.27 1.52 0.80 -0.08
quat -0.00 -0.39 -0.06 0.15
quat 0.08 -1.29 1.15 -0.13
quat -0.09 0.59 -0.01 -0.00
quat 0.17 -1.21 -1.61 -1.58
quat -1.64 0.68 1.30 0.27
quat 0.00 0.00 -0.00 -0.45
quat 0.74 -0.53 1.89 0.80
quat -1.32 0.80 -0.08 0.59
quat -0.47 -0.08 0.17 -1.21
quat -1.57 -0.43 -0.72 -0.77
quat 0.59 -0.01 0.00 -0.00
quat -1.21 1.94 -0.29 -0.07
quat -0.82 -1.86 1.09 0.80
quat -0.00 0.00 -0.45 -0.07
quat 1.75 -1.13 1.39 -1.06
quat 0.80 -0.07 0.59 -0.01
quat -0.06 0.15 -1.21 0.27
quat 1.14 0.80 -1.52 -1.63
quat -0.01 0.00 -0.00 0.00
quat 0.20 -1.87 -1.69 -1.60
quat 0.31 0.61 0.80 -0.07
quat 0.00 -0.42 -0.04 0.15

and on and on and on like that...
Help understanding this would be appreciated.

Thanks!

Help understanding this would be appreciated.

What would you like to understand?

jbellavance:
What would you like to understand?

Not really sure what these numbers mean, that's all.

Not seeing the code, I don't know either. But I bet it has to do with acceleration or g forces.

Read: How to use this forum - please read. and post your code.

Of course!
Here you are:

MPU6050_DMP6.ino (15.6 KB)

Why don’t you do a bit of reading about your module and the library and look at the print statements in the code ? You’ll see something like

    #ifdef OUTPUT_READABLE_QUATERNION
            // display quaternion values in easy matrix form: w x y z
            mpu.dmpGetQuaternion(&q, fifoBuffer);
            Serial.print("quat\t");
            Serial.print(q.w);
            Serial.print("\t");
            Serial.print(q.x);
            Serial.print("\t");
            Serial.print(q.y);
            Serial.print("\t");
            Serial.println(q.z);
        #endif

There are other #define you could have to print something else

I will do that. Thanks!