The issue is that you're using 1 bit per pixel, so 8 bits are in each byte - and you're trying to retrieve bytes. If you used:
var g = Graphics.createArrayBuffer(5,7,8, {zigzag:true});
Then I'm pretty sure that'll work fine. I'm not sure what you're planning but you may find you don't want the zigzag:true either, as that will make alternate scanlines reversed.
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.
The issue is that you're using 1 bit per pixel, so 8 bits are in each byte - and you're trying to retrieve bytes. If you used:
Then I'm pretty sure that'll work fine. I'm not sure what you're planning but you may find you don't want the
zigzag:true
either, as that will make alternate scanlines reversed.