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

    M5Core detects pressure on key A even if the key was not pressed at all.

    Cores
    2
    4
    5.8k
    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.
    • P
      Peter
      last edited by Peter

      I discovered by accident that the M5Core sends out a command via MQTT, even if the associated button was not pressed at all. Has anyone ever observed something similar. What can be the reason. It only occurs with key A.

      I have written a program to control my marquee in UIFlow. Here is the resulting Micropython code:

      def buttonA_wasPressed():
        global temp, prog_name, lfd_nummer, version, data_update, balkon, wohn_zimmer, testraum, message
        m5mqtt.publish(str('whg/balkon/markiese/strg'),str(lfd_nummer))
        lab_status.setText(str(lfd_nummer))
        lab_status.show()
        lfd_nummer = (lfd_nummer if isinstance(lfd_nummer, Number) else 0) + 1
        pass
      btnA.wasPressed(buttonA_wasPressed)
      

      Unfortunately, the indentations are swallowed. Is there a way to format code?

      Peter

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

        Hello @Peter

        could be the issue discussed here. Or this one. Not sure how to fix though.

        Yes, you can mark a code block using the back tick three times in a row ``` at the beginning of the line before and after the code block.

        def buttonA_wasPressed():
        

        Thanks
        Felix

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

        P 2 Replies Last reply Reply Quote 0
        • P
          Peter @felmue
          last edited by

          @felmue
          Thank you for the information.

          I will have a look at the links. At first glance it might fit.

          Peter

          1 Reply Last reply Reply Quote 0
          • P
            Peter @felmue
            last edited by Peter

            @felmue

            The tip has hit the problem. I have implemented a query of the key A in the callback routine after 1 ms. Only if the key is still pressed the routine is executed. Otherwise nothing is done. Now there are no more key presses from the ghost.

            Thanks

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