Hmm. I think it's doing the right thing - maybe Rick can say for sure.
It fails because of writing display.clear - because there's already Graphics.prototype.clear.
There are some other things though:
It's best to leave off the fillRect function. If you don't supply it, Espruino will use its own (which will be native code and so faster).
I'd really recommend that in this case you use Graphics.createArrayBuffer because it'll be faster/more efficient. I'm planning on adding rotation to Espruino at some point - but for now you could do rotation more efficiently in a flip function anyway :)
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.
Hmm. I think it's doing the right thing - maybe Rick can say for sure.
It fails because of writing
display.clear
- because there's alreadyGraphics.prototype.clear
.There are some other things though:
fillRect
function. If you don't supply it, Espruino will use its own (which will be native code and so faster).Graphics.createArrayBuffer
because it'll be faster/more efficient. I'm planning on adding rotation to Espruino at some point - but for now you could do rotation more efficiently in aflip
function anyway :)