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

    How to add touchscreen buttons to the Core S3

    UiFlow 2.0
    7
    8
    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.
    • D
      Don01
      last edited by

      Somehow I'm unable to find an answer to this seemingly simple question..

      I have never used UiFlow 1, but it appears to be very easy to add buttons that can be pressed on the touchscreen. A button element appears to be right there in the list on the left hand side.

      However, in UiFlow 2.0, the button element appears to be missing in the list on the left hand side.

      How can UI butttons be added in UiFlow 2.0?

      Thank you in advance for letting me know.

      1 Reply Last reply Reply Quote 2
      • I
        IsoEek
        last edited by

        Did you figure out how to add buttons? I have a S3 coming Monday. I'll share how to do it if I figure it out. I'm new to programming, but I'll do my best to help you.

        1 Reply Last reply Reply Quote 0
        • M
          mtylerjr
          last edited by mtylerjr

          There is probably some funtionality around that that hasnt been added yet (still in alpha)

          But maybe add the "Touch" component, and the "Logic" component to your program, and see if you can do something with this type of pattern:

          0_1693461433509_f51a438e-9bb8-45ac-846a-fc8b277da3b6-image.png

          (touchpoint is just a variable I added)

          I havent tried this - I was just looking around in UIflow2 for what could be used.

          It looks like you might need to manually check if a touch point is within some drawn UI feature, and handle that yourself.

          In any case, I couldnt find anything that looked like screen/touchbutton event handlers, only physical gpio pin push event handlers.

          1 Reply Last reply Reply Quote 2
          • G
            gerber2
            last edited by

            I had the same problem, it seems like on S3, the libraries are not extended that far. I was struggling though with the touch count. When I touch the screen, it increases to 1, and even after a 10sec sleep, and a "touch update", it still shows 1 for another two iterations, until it goes back to 0.

            With this, it's kind of not usable for me unfortunately. I will have to wait for the next proper version I assume?

            1 Reply Last reply Reply Quote 1
            • I
              IsoEek
              last edited by

              That's unfortunate to hear.

              1 Reply Last reply Reply Quote 0
              • G
                Gunter Braga
                last edited by

                Dear friends,

                I also encountered this difficulty in UiFlow 2.0, but I was able to successfully add buttons to the screen in an alternative way, but it worked very well. The code is very simple and only serves to demonstrate a way to implement buttons on the touch screen. On the screen, there are three buttons that, when pressed, adjust the screen brightness according to the brightness percentage written on them.

                0_1700674916340_uiflow2_block_1700674595732.png

                J 1 Reply Last reply Reply Quote 1
                • J
                  jdbaluch @Gunter Braga
                  last edited by

                  @gunter-braga thanks for this bit of code! I got it running but don't find it to be very sensitive. Sometimes I have to push the button several times to get it to function correctly. Are there any other ways to implement the touch code that are more responsive?

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

                    Hello guys

                    I've created an example - using a simple button class - which simulates the three buttons (BtnA, B and C) at the bottom of the display.

                    0_1702327184703_UIFlow2_M5CoreS3_BtnABC_20231211.png

                    Thanks
                    Felix

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

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