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

    (Solved)M5StickC+ToF:I2C bus error (19)

    UIFlow
    2
    4
    5.6k
    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.
    • K
      Koms
      last edited by Koms

      While using the M5StickC with the M5STACK-TOF-UNIT "Dostance Sensor" connected I receive the following error when running the simple block code on UIFlow

      It used to work fine(using same code), but suddenly I receive the error.

      Error:
      I2C bus error (19)

      Code(from UIFlow)

      from m5stack import *
      from m5ui import *
      from uiflow import *
      import time
      import unit
      
      setScreenColor(0x111111)
      tof0 = unit.get(unit.TOF, unit.PORTA)
      
      
      
      label0 = M5TextBox(8, 27, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
      
      
      while True:
        label0.setText(str(tof0.distance))
        wait(1)
        wait_ms(2)
      

      I try another code also, but I still recieved same error.
      it looks like

      tof0 = unit.get(unit.TOF, unit.PORTA)

      part might has a probelm.

      from m5stack import *
      from m5ui import *
      from uiflow import *
      import time
      import unit
      
      setScreenColor(0x111111)
      tof0 = unit.get(unit.TOF, unit.PORTA)
      
      
      
      
      
      label0 = M5TextBox(8, 27, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
      
      
      while True:
        label0.setText(str('Hello M5'))
        wait(1)
        wait_ms(2)
      

      Any suggestions would be appreciated.

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

        Hello @Koms

        I am running your code just fine with UIFlow firmware 1.7.3 on my M5StickC.

        • are you using the latest UIFlow firmware?
        • have you tried another cable? (I get error 19 when I disconnect the unit)
        • is the cable plugged in all the way?

        Thanks
        Felix

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

        1 Reply Last reply Reply Quote 0
        • K
          Koms
          last edited by

          Hi! @felmue

          Thank you for your advices.

          are you using the latest UIFlow firmware?

          Yes

          have you tried another cable? (I get error 19 when I disconnect the unit)

          I tried another cable, the problem is solved!

          Thank you so much!

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

            Hello @Koms

            you are welcome. Thank you for reporting back. I am glad to hear you got it working.

            Cheers
            Felix

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

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