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

    Bug? uiFlow 1.4.5 Stick C IMU ypr[] (getX and getY) values are weird.

    Bug Report
    3
    6
    9.1k
    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.
    • liemphL
      liemph
      last edited by

      I tried to get the roll, pitch, and yaw (ypr[]) of Stick-C IMU using uiFlow 1.4.5 (and 1.4.5.1) but the values seemed weird. X( ypr[1]) and Y (ypr[2]) are decreasing from time to time until the variables getting overflowed. I have checked my IMU using C++ (Ardunio IDE) and all were OK.

      liemphL 2 Replies Last reply Reply Quote 0
      • liemphL
        liemph @liemph
        last edited by

        @liemph 0_1586821645884_65c18c68-5715-48e8-abb6-730d5d2eccd8-image.png

        1 Reply Last reply Reply Quote 0
        • liemphL
          liemph @liemph
          last edited by liemph

          @liemph

          from m5stack import *
          from m5ui import *
          from uiflow import *
          lcd.setRotation(1)
          import imu
          import hat
          
          setScreenColor(0x111111)
          
          hat_bugc0 = hat.get(hat.BUGC)
          
          
          imu0 = imu.IMU()
          label0 = M5TextBox(34, 10, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)
          label1 = M5TextBox(35, 33, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)
          label2 = M5TextBox(10, 10, "X", lcd.FONT_Default,0xFFFFFF, rotate=0)
          label3 = M5TextBox(9, 34, "Y", lcd.FONT_Default,0xFFFFFF, rotate=0)
          
          raw_x = None
          raw_y = None
          
          
          
          raw_x = 0
          raw_y = 0
          while True:
            raw_x = imu0.ypr[1]
            raw_y = imu0.ypr[2]
            label0.setText(str(raw_x))
            label1.setText(str(raw_y))
            wait(1)
            wait_ms(2)
          
          m5stackM 1 Reply Last reply Reply Quote 0
          • m5stackM
            m5stack @liemph
            last edited by m5stack

            @liemph thank you feedback . you could delete wait block to solve it. our engineer will fix it later .

            1 Reply Last reply Reply Quote 0
            • I
              iPodLux
              last edited by

              Hi, the problem is still there. Removing the wait block kinda of fix it but reading are inconsistent. Any fix?

              Thanks

              liemphL 1 Reply Last reply Reply Quote 0
              • liemphL
                liemph @iPodLux
                last edited by

                @ipodlux For the time being, I stopped using uiFlow (or Python) for IMU related project. It is not reliable and it is slow. Use Arduino IDE, you will have a much faster code and reliable result.

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