Hi - yes, it's an issue with JavaScript's handling of arrays. Since arrays can hold absolutely anything, by default they're not very memory efficient.
However if you tell Espruino what you want to put in them then you can do much better. Try:
var cmd={
On: new Float32Array([8.97,4.42 ... ]),
Down: new Float32Array([8.97,4.42 ...])
etc
and you should be fine (it'll be around 8 times more efficient!). You can compact them down even more (for instance storing them in an array of bytes), but then you have to worry about scaling.
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 - yes, it's an issue with JavaScript's handling of arrays. Since arrays can hold absolutely anything, by default they're not very memory efficient.
However if you tell Espruino what you want to put in them then you can do much better. Try:
and you should be fine (it'll be around 8 times more efficient!). You can compact them down even more (for instance storing them in an array of bytes), but then you have to worry about scaling.
There's a bit more information about memory efficiency here: http://www.espruino.com/Performance