In the last entry on our Community Projects Hub on Hackster, the author used a nice trick to configure the pins with a For loop.



for loops are traditionally used when you have a block of code which you want to repeat a fixed number of times. The Python for statement iterates over the members of a sequence in order, executing the block each time. [ For Loop on Python wiki

`pumps = [D5, D3, D1] # list of pump control pins

valves = [D4, D2, D0] # list of valve control pins set the pins as OUTPUT, default state is OFF for pin in pumps+valves:

pinMode(pin,OUTPUT)

digitalWrite(pin,LOW)` More info:<br><ul><li><a rel="nofollow" href="https://docs.zerynth.com/latest/official/core.zerynth.stdlib/docs/quickpython.html#for-statements">For Statements</a></li><li><a rel="nofollow" href="https://docs.zerynth.com/latest/official/core.zerynth.stdlib/docs/official_core.zerynth.stdlib___builtins__.html#builtins.pinMode">pinMode()</a></li><li><a rel="nofollow" href="https://docs.zerynth.com/latest/official/core.zerynth.stdlib/docs/official_core.zerynth.stdlib___builtins__.html#builtins.digitalWrite">digitalWrite()</a></li></ul>Happy coding!

Here’s the code: