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

    Flow 2 Execute block

    UiFlow 2.0
    4
    9
    2.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.
    • N
      nunley21
      last edited by

      Hello I was wondering if flow 2 had "Execute block" and if not is there a timline or is this feature going to be added. I would like to be able to use both the block system and custom code.

      1 Reply Last reply Reply Quote 0
      • D
        dozauk
        last edited by

        A block to execute custom code?
        I use the Execute code block under System in UIFlow2

        0_1700839954421_5ba083aa-241e-49e1-b947-d72038c17f13-image.png

        I'm a relative newbie so excuse me if that's not what you meant

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

          Hello @nunley21

          in UIFlow2 the Execute code block is under System.

          Edit: looks like @dozauk was quicker!

          Thanks
          Felix

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

          ProfHusterP 1 Reply Last reply Reply Quote 0
          • ProfHusterP
            ProfHuster @felmue
            last edited by

            @felmue ,
            I am running V2.3.8, and all I see under System is "Execute mpy code (e.g. import)" and "Execute mpy code". I tried putting the block

            Execute mpy code [print("## HELLO ##")]
            

            in the loop, but it had no effect. In fact, it wasn't translated to python code in the code window.

            Did inserting python code directly get dropped?
            Michael Huster

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

              Hello @ProfHuster

              hmm, works for me with M5Tab5 UIFlow2 v2.3.9. It also got translated into Python code window.

              Thanks
              Felix

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

              ProfHusterP 1 Reply Last reply Reply Quote 0
              • ProfHusterP
                ProfHuster @felmue
                last edited by

                Hello @felmue,

                I only get

                execute mpy code []
                

                as a block. UIFlow2.0-Tab5.png

                You can see I reloaded and got V2.3.9. I get the same whether I choose a Tab5 or an Atom Echo. Or M5GFX or M5UI for the Tab5.

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

                  Hello @ProfHuster

                  below is an example filled with print("hello"):

                  UIFlow2_ExecuteMpyCodeBlock_20251209.png

                  Please also have a look at my example in the UIFlow2 Project Zone called: M5Tab5_ExecuteMpyCodeTest_UIFlow2.3.9

                  Thanks
                  Felix

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

                  ProfHusterP 1 Reply Last reply Reply Quote 0
                  • ProfHusterP
                    ProfHuster @felmue
                    last edited by

                    @felmue,

                    Thanks, that worked. I think what happened is I clicked on the code window and did some editing, then went back to the blockly panel. It seemed when I did that, the blockly no longer updated the actual python code.

                    I will check out your examples,

                    Prof Huster

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

                      Hello @ProfHuster

                      yes, that is what I observed too. As long as edit mode in Python code window is enabled, changes on the blockly side get ignored. (I guess that's to prevent changes from being overwritten.)

                      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