Ahh, and I just realised - the module itself that you copied that code from is perfectly JS compliant and fine.
The problem is that Graphics.buffer is an ArrayBuffer (so untyped). You replaced it with a Uint8Array :)
Graphics.buffer
ArrayBuffer
Uint8Array
@Gordon started
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.
Ahh, and I just realised - the module itself that you copied that code from is perfectly JS compliant and fine.
The problem is that
Graphics.buffer
is anArrayBuffer
(so untyped). You replaced it with aUint8Array
:)