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

    IMU Get ACC reports gyro

    UIFlow
    3
    3
    5.2k
    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
      FracMan
      last edited by

      There appears to be an issue with the IMU module in M5Flow. The function "Get X Acc" appears to report the orientation of the device, instead of the accelleration. Here is the python code to reproduce it:

      from m5stack import *
      from m5ui import *
      from uiflow import *
      import imu

      setScreenColor(0x222222)

      imu0 = imu.IMU()

      while True:
      lcd.clear()
      lcd.print((imu0.acceleration[0]), 0, 0, 0xffffff)
      lcd.print((imu0.acceleration[1]), 0, 20, 0xffffff)
      wait_ms(400)
      wait_ms(2)

      If you run the program, the displayed numbers are between -1 and 1 depending on how you turn the device.

      I also tried the C/C++ example for the M5Stack located here: https://github.com/m5stack/M5Stack/blob/master/examples/Basics/IMU/IMU.ino
      This example seems to run fine.

      J 1 Reply Last reply Reply Quote 0
      • J
        jhfoo @FracMan
        last edited by

        @fracman I am observing possibly a similar situation. Get X Gyr seems to return an unpredictable and small (-2 to 2) range no matter how I turn my M5StickC.

        Are the values read from current IMU meters, or are data buffered? Feels like the latter.

        1 Reply Last reply Reply Quote 0
        • ajb2k3A
          ajb2k3
          last edited by

          it could be that the gyro is in Gravities which would explain the low reading.
          I was watching a vid and normally the readings shoud be in miligravities.

          UIFlow, so easy an adult can learn it!
          If I don't know it, be patient!
          I've ether not learned it or am too drunk to remember it!
          Author of the WIP UIFlow Handbook!
          M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

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