Having to create a chunk of memory just to keep a clock going with all the same sent byte can throw you into "Out of Memory" jail... I would prefer having similar solution as with the write. Even though an object definition costs too, for larger amounts of bytes it still provides a less memory intensive solution.
Another options is to have 2nd argument as a count, and current optional ssn pin argument type checked: with no repetition count pin is 2nd argument, with repetition count, pin is 3rd argument - pin is though always last element if present. 1st argument is still single argument.
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.
Having to create a chunk of memory just to keep a clock going with all the same sent byte can throw you into "Out of Memory" jail... I would prefer having similar solution as with the write. Even though an object definition costs too, for larger amounts of bytes it still provides a less memory intensive solution.
Another options is to have 2nd argument as a count, and current optional ssn pin argument type checked: with no repetition count pin is 2nd argument, with repetition count, pin is 3rd argument - pin is though always last element if present. 1st argument is still single argument.