jrowberg / i2cdevlib

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

How to acces mpu6050 gy 87 inclue Hmc5883l #325

Open jzishwa opened 7 years ago

jzishwa commented 7 years ago

I want to use yaw data, with hmc5883l for stable data. Anyone can help me?

italogsfernandes commented 7 years ago

https://github.com/kriswiner/MPU6050/wiki/Affordable-9-DoF-Sensor-Fusion

2017-09-05 3:10 GMT-03:00 jzishwa notifications@github.com:

I want to use yaw data, with hmc5883l for stable data. Anyone can help me?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jrowberg/i2cdevlib/issues/325, or mute the thread https://github.com/notifications/unsubscribe-auth/AMV_HGCkm-60jvO14hTqHjZ-MibqXlhGks5sfOXegaJpZM4PMew1 .

-- Ítalo G S Fernandes Graduando em Engenharia Biomédica Biolab - Laboratório de Engenharia Biomédica FEELT - Faculdade de Engenharia Elétrica UFU - Universidade Federal de Uberlândia

jzishwa commented 7 years ago

i can't find mpu6050+hmc5883l code, just mpu9250. can you help me to give its code, thank's

italogsfernandes commented 7 years ago

Neither the MPU6050_6Axis_MotionApps20.h or MPU6050_9Axis_MotionApps41.h work with the hmc5883l. For get the values from the hmc5883l you need to use this function in the setup: void setI2CBypassEnabled(bool enabled); Line 1507 of this file: https://github.com/jrowberg/i2cdevlib/blob/master/Arduino/MPU6050/MPU6050.cpp

Enabling this function allows you to use the hmc5883l library for get the mag readings.

To fuse the mag values to the quaternion, i did'nt find any easy way. My final approache was to do the sensor fusion using Madgwick Algorithm.