SouthernAtHeart Posted April 4, 2014 Report Share Posted April 4, 2014 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 Quote Link to comment Share on other sites More sharing options...
luisrodenas Posted April 7, 2014 Report Share Posted April 7, 2014 int16_t gyro[3]; mpu.dmpGetGyro(gyro, fifoBuffer); use it before or after your block: mpu.dmpGetQuaternion(&q, fifoBuffer);mpu.dmpGetGravity(&gravity, &q);mpu.dmpGetYawPitchRoll(ypr, &q, &gravity); Quote Link to comment Share on other sites More sharing options...
SouthernAtHeart Posted April 9, 2014 Author Report Share Posted April 9, 2014 int16_t gyro[3]; mpu.dmpGetGyro(gyro, fifoBuffer); use it before or after your block: mpu.dmpGetQuaternion(&q, fifoBuffer); mpu.dmpGetGravity(&gravity, &q); mpu.dmpGetYawPitchRoll(ypr, &q, &gravity); Thanks! I thought I'd have to drop the DMP code and just start over with the raw data code. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.