this works excellent for Espruino
var C = { OLED_WIDTH : 128, OLED_CHAR : 0x40, OLED_CHUNK : 128 }; WIDTH = 128; HEIGHT = 64; var buffer = new Uint8Array((WIDTH * HEIGHT)/ 8); bufferLen = buffer.length; var chunk = new Uint8Array(C.OLED_CHUNK+1); chunk[0] = C.OLED_CHAR; for (var p=0; p < bufferLen; p+=C.OLED_CHUNK) { console.log(p +"-"+(p+C.OLED_CHUNK)); chunk.set(new Uint8Array(buffer,p,C.OLED_CHUNK), 1); }
but anywhere else it causes something like "RangeError: Offset/length out of range" for chunk.
Any suggestions how to rewrite this line
chunk.set(new Uint8Array(buffer,p,C.OLED_CHUNK), 1);
to work with other javascript engines ?
@MaBe 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.
this works excellent for Espruino
but anywhere else it causes something like "RangeError: Offset/length out of range" for chunk.
Any suggestions how to rewrite this line
to work with other javascript engines ?