🤖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.

    Scheduled Pinned Locked Moved Bug Report
    6 Posts 3 Posters 11.4k Views 1 Watching
    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 Offline
      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 Offline
        liemph @liemph
        last edited by

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

        1 Reply Last reply Reply Quote 0
        • liemphL Offline
          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 Online
            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 Offline
              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 Offline
                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

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • First post
                  Last post