🤖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

    Scheduled Pinned Locked Moved Bug Report
    5 Posts 3 Posters 10.5k 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.
    • M5StickFreaklerM Offline
      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 Offline
        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 Offline
          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 Offline
            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 Offline
              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

              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