Well, when it's working right, the buf argument should point to the correct buffer, so there'll be need for that?
Having an array would work, but would use up a little bit more RAM and would be a tiny bit slower. It would make more sense though... Only problem is it would stop pretty much all existing code that used waveforms from working - I'm likely to annoy far more people with that than I'll make happy with the change :)
You can easily fake it though. Right after creating the Waveform class, do:
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.
Well, when it's working right, the
buf
argument should point to the correct buffer, so there'll be need for that?Having an array would work, but would use up a little bit more RAM and would be a tiny bit slower. It would make more sense though... Only problem is it would stop pretty much all existing code that used waveforms from working - I'm likely to annoy far more people with that than I'll make happy with the change :)
You can easily fake it though. Right after creating the Waveform class, do: