🤖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.

    Scheduled Pinned Locked Moved Cores
    4 Posts 2 Posters 7.3k Views
    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 Offline
      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 Offline
        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 Offline
          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 Offline
            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

            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