Actually adding the ability to specify an array instead of a single pin for pinMode would be pretty easy and as you say it could be very flexible.
As you note it is a bit of a rabbit hole though... - like supplying different modes for each pin, and then output high/low/etc.
Right now, nothing stops you from [A,B,C].forEach(p=>p.mode("input")); which isn't too painful.
I just answered this post and I wonder whether this isn't a very similar case. At the end of the day having a faster JS interpreter for executing a long series of function calls would probably be a lot more usable than me going around adding lots of 'bulk execution' functionality to Espruino's existing APIs.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi,
Actually adding the ability to specify an array instead of a single pin for pinMode would be pretty easy and as you say it could be very flexible.
As you note it is a bit of a rabbit hole though... - like supplying different modes for each pin, and then output high/low/etc.
Right now, nothing stops you from
[A,B,C].forEach(p=>p.mode("input"));
which isn't too painful.I just answered this post and I wonder whether this isn't a very similar case. At the end of the day having a faster JS interpreter for executing a long series of function calls would probably be a lot more usable than me going around adding lots of 'bulk execution' functionality to Espruino's existing APIs.