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

    Button lock

    Micropython
    2
    3
    5.0k
    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.
    • T
      tialm
      last edited by

      Hi! I am having a problem while using different functionalities of the M5stack buttons.

      1. So I have a program where when I longpress the B button I go to a certain menu. In that menu when I (normal) press B button it starts a function that uses the NCIR unit (makes 10 temperature readings and then stops). But some strange thing is happening.When I press the B button to make the readings, at the end of the readings it will call the Long Press function again and I don't want this to happen. Is this the supposed behavior?
      2. Also, if I have a longpress assigned and for example a loop that keeps on going if a button is pressed using the isPressed function at the end of that loop the longpressed function will be called anyway... How can I avoid this?
        Thank you for the help! Let me know if my question is confuse and I can make it in other way.
      1 Reply Last reply Reply Quote 0
      • ajb2k3A
        ajb2k3
        last edited by

        Can you post your code please?

        UIFlow, so easy an adult can learn it!
        If I don't know it, be patient!
        I've ether not learned it or am too drunk to remember it!
        Author of the WIP UIFlow Handbook!
        M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

        1 Reply Last reply Reply Quote 0
        • T
          tialm
          last edited by

          Sorry! @ajb2k3 I have not forgot about this, I am a bit withou time, a lot to do for work right now!
          But I'll sketch up an example soon!
          Thank you for the help

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