rpicopter / MotionSensorExample

MPU6050/MPU6500/MPU9150/MPU9250 over I2c for RaspberryPi
137 stars 80 forks source link

Fail to read compass #3

Open Zhehua-Hu opened 9 years ago

Zhehua-Hu commented 9 years ago

Hi,I'm using your code to test MPU9250(Based on STM32F429),and I fail to read the compass value . And I notice that in ms_open() you didn't open it as below mpu_set_sensors(INV_XYZ_GYRO|INV_XYZ_ACCEL),

After adding INV_XYZ_COMPASS as argument,it still does not work.Maybe you can take a little time to test it. Thanks!

gregd72002 commented 9 years ago

Hi, You might need to set the sample rate as well. Take a look at this: https://github.com/rpicopter/AvrMiniCopter-Arduino/blob/master/mpu.cpp#L66

To retrieve the values: https://github.com/rpicopter/AvrMiniCopter-Arduino/blob/master/mpu.cpp#L144

Hope this helps

ryanleofficial commented 7 years ago

Hi I've tried your suggestion but I still cannot retrieve the compass value! Any other suggest would help.

Thank you,