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"

#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
MPU6050 mpu;
#include "Wire.h"

#endif



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

 int Xaxis; 



void setup() 
{
    Wire.begin();
    Serial.begin(9600);

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

}

void loop()
{










   Xaxis= ypr[2] * 180/M_PI;
   Serial.println(Xaxis);
  
 }
  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?