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

  • I tried to get the roll, pitch, and yaw (ypr[]) of Stick-C IMU using uiFlow 1.4.5 (and 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.

  • @liemph

    from m5stack import *
    from m5ui import *
    from uiflow import *
    import imu
    import hat
    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]

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

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


  • @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.