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, powered by microcosm.
Report a problem