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

    Touch Button Widget for Paper S3

    UiFlow 2.0
    4
    5
    410
    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.
    • S
      Schwibach
      last edited by

      Hello,

      I am new to M5Stack in general and just ordered my first Paper S3.
      My use case is this:
      I want to create a meeting room display that can call an API (Get Request) and then display the JSON data (simple object with some strings) as labels. Those will be things like is the room free, occupied, when is the next meeting...

      If the room is currently free, I want three touch buttons that allow to book the room for 15, 30 or 45 minutes. That will send an http post to a different endpoint.

      UIFlow 2 does not seem to have a widget or any other way to add a touch button as a visual element. I could create a rectangle and them some text.
      But if I start to change code in the python area on the right, those things will not translate to the visuals on the left.

      I'm curious how you are supposed to create buttons in UIFlow2.

      Also, I'm struggling with the graphic interface with the blocks of code.
      Is there any tutorial that will walk me through creating a simple project on the Paper S3? The 2-3 minute Youtube videos only give a very superficial overview. I would need more guidance.

      And my last question: How do I find out, what widgets exist and what the expected parameters are? That would help me a lot.

      If somebody reads this and feels sympathy and would take some time to get me on track to build the first project.

      S 1 Reply Last reply Reply Quote 1
      • S
        spongefile @Schwibach
        last edited by

        @Schwibach I have the same question. I created a rectangle, and then I thought there would be an obvious way to say "when rectangle touched", but there isn't. I think you need to find the location of the rectangle and then determine "when a touch happens within this area". Which is a whole lot of math for what would seem to be such an obvious component.

        1 Reply Last reply Reply Quote 0
        • robskiR
          robski
          last edited by

          you prob need to read touch coordinates and if they are in range x1-x2 and y1-y2 (button area) function can be executed

          M5StickC, M5StickCPlus, M5StickCplus2,M5GO, M5Core, M5Tough, M5Core2, M5 Demo Board, M5Dial, M5Paper, M5Atom, M5Cardputer, M5StampS3, CoreMP135, StamPLC, AirQ, M5Tab

          S 1 Reply Last reply Reply Quote 0
          • S
            Schwibach @robski
            last edited by

            Thank you guys!
            Are there any templates or an app that I could look at?

            If I were the company making this product, I would release a few different apps that showcase these features and how they think you would implement them.

            I couldn't find any documentation, about the widgets etc. that exist for the PaperS3. Is there no such thing as proper documentation for the different blocks and how they are supposed to be used?

            I agree that with what I have on hand, trying to use a rectangle with the coordinates would be the way to go. Unfortunately, it's not obvious to me how to go about this. Even with the few things I managed to do, I retro-engineered from another app.

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

              Hello @Schwibach

              while using UI designer to draw a rectangle works fine, getting the rectangle's parameters (e.g. x, y, ...) is not implemented (at least I couldn't find any get functions for rectangles).

              That said, I created a Micropython example which uses a Button class to draw the buttons, labels and check for touch. You can find it here. It's not using the UI designer nor is it using blocks but it should give you an idea hopefully.

              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