jrowberg / i2cdevlib

I2C device library collection for AVR/Arduino or other C++-based MCUs
http://www.i2cdevlib.com
3.95k stars 7.51k forks source link

How Can I get Gyro data using the MPU6050_test library #145

Open ozanio opened 9 years ago

ozanio commented 9 years ago

I have tried adding the line mpu.dmpGetGyro(gyro, fifoBuffer); as below

mpu.dmpGetQuaternion(&q, fifoBuffer); mpu.dmpGetGyro(gyro, fifoBuffer); mpu.dmpGetGravity(&gravity, &q); mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);

but I get a "gyro was not declared in this scope error" so I added the line "float gyro[3];" at the top of the code where float euler[3]; was which gave me a "no matching function error"

How can I fix this?

ghost commented 9 years ago

I guess you should post the complete code, makes it easier for others to debug.

Arrowana commented 9 years ago

use getMotion6()

mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);

to get all 3 accelerations and gyroscopes

sguillia commented 7 years ago

Use int gyro[3] instead of float gyro[3]