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

    Interrupt routine for remote switch in UIFlow

    UIFlow
    2
    4
    6.1k
    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.
    • W
      Werner_G
      last edited by

      Putty, the walking robot can go forward or backwards. When walking, I cannot stop or switch direction using a remote switch, because I cannot interrupt the flow. An interrupt routine is needed I guess. I found examples for a H/W pin interrupt, but not for S/W. Can anyone please help me?

      0_1629196276245_puppy.png

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

        actually, we don't suggest putting the loop to the callback function. I think you could create a variable to save the current state, and then use the remote callback to change the state.

        1 Reply Last reply Reply Quote 0
        • W
          Werner_G
          last edited by

          Thank you. Don't understand what you suggest, but finally I got it working like this:
          0_1629374477997_puppy2.png
          Maybe you have better idea!

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

            @werner_g that's what I mean. haha. you did it.

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