Jump to content
I2Cdevlib Forums

using the DMP example code, but also getting the gyro reading


Recommended Posts

I have based my Arduino code on the DMP example, so I get an angle reading from the 6050 like this:

#ifdef OUTPUT_READABLE_YAWPITCHROLL
    mpu.dmpGetQuaternion(&q, fifoBuffer);
    mpu.dmpGetGravity(&gravity, &q);
    mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);
    pitch = (float(ypr[1] * 180/M_PI)); //angle of platform
    pitch = pitch - pitchOffset; //compensate for platform level point
    pitch = pitch * 100;
    angle = int(pitch);
#endif

but I also need to get the gyroY reading from the chip.  I see this in the other example of raw readings, which gives the raw readings:

MPU6050 accelgyro;
//MPU6050 accelgyro(0x69); // <-- use for AD0 high

int16_t ax, ay, az;
int16_t gx, gy, gz;

   The readings can then be found with this: accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
But this function doesn't work with the DMP code.
Is there a simple way to use the DMP code and also get the raw gyro reading? Thanks
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...