MPU 6050_DMP6 help

Hello all,

I am trying to create my own library from the MPU6050_DMP6 code. What I am trying to do is display the X value from the MPU 6050. I am fully aware that I can easilly do it from the MPU6050_DMP6 code in the void loop. I am new to arduino and I have been working on this all weekend with zero luck. Can someone please take a look at my code below , and help me to understand where I went wrong? Thank you.

#include "I2Cdev.h"
#include "MPU6050.h"

MPU6050 mpu;
#include "Wire.h"


float ypr[3];           // [yaw, pitch, roll]   yaw/pitch/roll container and gravity vector

 int Xaxis; 

void setup() 

    Serial.println("Initialize MPU");
    Serial.println(mpu.testConnection() ? "Connected" : "Connection failed");


void loop()

   Xaxis= ypr[2] * 180/M_PI;
  float ypr[3];           // [yaw, pitch, roll]   yaw/pitch/roll container and gravity vector

It might be the way this array is defined: here is an example from the PLAYGROUND:

int ledPins[] = {  2, 7, 4, 6, 5, 3 };       // an array of pin numbers to which LEDs are attached

which leads me to believe your array should be :

    float ypr[] = {yaw, pitch, roll};

but I could be wrong.

Thanks for the reply, and help but that didnt work. Does anyone else have any suggestion?