[Solved] IMU - MPU9250
-
Hi
I've tried to use the accelerometer in arduino IDE with a Fire stack
I did try the examples at MakerFactory and it works for the AK8963 chip (IMU.initAK8963(IMU.magCalibration);
Unfortunately IMU.calibrateMPU9250(IMU.gyroBias, IMU.accelBias); does not work, nor does readGyroData or readAccelData. It does not print anything, screen flashes and Fire keeps rebooting for ever, so I can't use accelerometer/gyro
The hardware is ok as I could use it with UIFlow
I tried the WHO_I_AM thing and it says MPU9250: I am 19 / I should be 71
Could it be the problem ?
When I comment out IMU.calibrateMPU9250(IMU.gyroBias, IMU.accelBias), no more reboot - but of course it only shows 0s, so it's not very useful -
Hello @F3l1x
AFAIK MPU6886 reports
0x19
as WHO_AM_I. I think you already might have a newer M5Stack Fire which uses an MPU6886 - please see version history here:https://docs.m5stack.com/#/en/core/fire?id=version-change
Have you tried below code? Looks like it can deal with all IMUs ever used in stacks.
https://github.com/m5stack/M5Stack/blob/master/examples/Basics/IMU/IMU.ino
Good luck!
Felix
-
Thanks so much, Felix !
-