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

    Button key pressed event catched without key was pressed

    Bug Report
    3
    5
    8.7k
    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.
    • M5StickFreaklerM
      M5StickFreakler
      last edited by M5StickFreakler

      Hi folks

      Load the code below to a M5Stack device.
      then run for more than 30 min.
      DO NOT PRESS ANY KEY WHILE RUNNING!
      Do you see that the screen has changed the color?
      It means that a keypressed event was catched.

      Is this bug known?
      maybe https://github.com/m5stack/M5Stack/issues/52 (2 years old!!!)

      from m5stack import *
      from m5ui import *
      from uiflow import *
      import wifiCfg

      ip = wifiCfg.wlan_sta.ifconfig()

      lcd.clear()
      lcd.font(lcd.FONT_DejaVu18)
      lcd.print('initializing...', 0, 0, 0xffffff)
      wifiCfg.screenShow()
      wifiCfg.autoConnect(lcdShow = True)

      setScreenColor(0x000000)

      def buttonA_wasPressed():
      lcd.fill(0xff0000)
      pass
      btnA.wasPressed(buttonA_wasPressed)

      def buttonB_wasPressed():
      lcd.fill(0x00ff00)
      pass
      btnB.wasPressed(buttonB_wasPressed)

      def buttonC_wasPressed():
      lcd.fill(0x0000ff)
      pass
      btnC.wasPressed(buttonC_wasPressed)

      Is there a workaround to avoid that?
      Its absolutely useless if an key pressed event is catched, if no key was pressed!

      Thanks ;-)
      Thomas

      1 Reply Last reply Reply Quote 0
      • O
        option
        last edited by

        I have the same button #52 issue.
        A small delay in the loop (ref comments in the issue) makes it a lot better, but I still experience it some times and need to keep that in account.

        1 Reply Last reply Reply Quote 0
        • m5stackM
          m5stack
          last edited by

          yeah...this bug was from the ESP IDF. As you see in the Github issues

          M5StickFreaklerM 1 Reply Last reply Reply Quote 0
          • M5StickFreaklerM
            M5StickFreakler @m5stack
            last edited by

            @m5stack said in Button key pressed event catched without key was pressed:

            yeah...this bug was from the ESP IDF. As you see in the Github issues

            And what can I do to avoid it? In this case I cannot use Button A. So the device is useless.

            1 Reply Last reply Reply Quote 0
            • m5stackM
              m5stack
              last edited by

              There is no good solution to this problem in UIFow. If it is in Arduino, you can refer to the issue mentioned in the issues to modify Digital read to Analog read

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