🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    [Solved] IMU - MPU9250

    Arduino
    2
    4
    7.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      F3l1x
      last edited by F3l1x

      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

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        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

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • F
          F3l1x
          last edited by

          Thanks so much, Felix !

          1 Reply Last reply Reply Quote 0
          • felmueF
            felmue
            last edited by

            Hi @F3l1x

            you are very welcome.

            Happy Stacking!
            Felix

            GPIO translation table M5Stack / M5Core2
            Information about various M5Stack products.
            Code examples

            1 Reply Last reply Reply Quote 0
            • First post
              Last post