[DIY]: Old-style function(with parameter)

I was about to ask: Is it possible to write a function like in C where several Switches can call this with a parameter?

I have 7 LED’s on my ESP32-BLE device and 7 switches on my Samsung Galaxy S8. Several things should be done when switching from/to true/false but in the end a function like turnLed(number, onoff){} could do it for all switches.

It is not documented that well but it is there and it works. Create a “Function” and give it a name. Right-mouse click on it and add parameters. Right-click again to “Get input” parameter. Get a function call by right click again or click in the left list under function.



great work @chlor ! I use this method to decrease the number of blocks i use in my apps! I will change this to the tutorial tag as it is more fitting there.