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

    Custom blocks with a variable input

    Custom Blocks
    2
    2
    4.3k
    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
      timtimw
      last edited by timtimw

      How to create a block that operates like a function? Variable (x) input to block, --> number crunching ---> returns a value
      I can make label blocks but have not an understanding of using variables in custom blocks
      Thanks

      1 Reply Last reply Reply Quote 0
      • S
        SE
        last edited by

        Hello,
        In case you don't have an answer here is an example of custom block I made for Parsing Text. It will ask for 3 inputs (via variables) and then return a result to a variable

        0_1644545334861_020d3478-9387-4d1f-82d9-f3af909e87b0-image.png

        Don't forget to use the ${} to reference your "Variables" when creating the formulas. It also reminds you when in the block creater.
        0_1644545551259_f6364133-289d-4d73-a3f0-970d1279bd9d-image.png

        This is what it looks like in UIFLOW. Note the 1st three are inputs and "DataResults" is the output. In my UIFLOW example DataParse and DataResults are UIFLOW variables not the same as the Custom Block variables

        0_1644545421783_5569aa80-88c6-4c0e-9803-3c0b28dd4fd0-image.png

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