That doesn't work I'm afraid:
var initCmds = new Uint8Array([ 0xAe, // 0 disp off 0xD5, // 1 clk div 0x80, // 2 suggested ratio 0xA8, 0, // 3 set multiplex, height-1 0xD3,0x0, // 5 display offset 0x40, // 7 start line 0x8D, extVcc?0x10:0x14, // 8 charge pump 0x20,0x0, // 10 memory mode 0xA1, // 12 seg remap 1 0xC8, // 13 comscandec 0xDA, 0x12, // 14 set compins, height==64 ? 0x12:0x02, 0x81, extVcc?0x9F:0xCF, // 16 set contrast 0xD9, extVcc?0x22:0xF1, // 18 set precharge 0xDb, 0x40, // 20 set vcom detect 0xA4, // 22 display all on 0xA6, // 23 display normal (non-inverted) 0xAf // 24 disp on ]);
Line 5 should be the height-1 and line 12 is hardcoded to 0x12 (should be 0x02 for 32 lines) .
// commands sent when sending data to the display var flipCmds = [ 0x21, // columns 0, C.OLED_WIDTH-1, 0x22, // pages 0, 7];
Line 6 should be 3 for 32 lines and 7 for 64.
exports.connectSPI = function(spi, dc, rst, callback, options) { update(options); var cs = options?options.cs:undefined; var oled = Graphics.createArrayBuffer(C.OLED_WIDTH,C.OLED_HEIGHT,1,{vertical_byte : true});
This code does not take into account a height set in the options.
@Chris 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.
That doesn't work I'm afraid:
Line 5 should be the height-1 and line 12 is hardcoded to 0x12 (should be 0x02 for 32 lines) .
Line 6 should be 3 for 32 lines and 7 for 64.
This code does not take into account a height set in the options.