You are reading a single comment by @Chris and its replies. Click here to read the full conversation.
  • Almost! You should also change the page max in flipCmds from 7 to 3 (but if you're just sending a 128x32 buffer then it still displays ok):

    var initCmds = new Uint8Array([ 0xAe, // disp off
                 0xD5, // clk div
                 0x80, // suggested ratio
                 0xA8, C.OLED_HEIGHT-1,
                 0xD3,0x0, // display offset
                 0x40, // start line
                 0x8D,extVcc?0x10:0x14, // charge pump
                 0x20,0x0, // memory mode
                 0xA1, // seg remap 1 (use 0xA0 to flip horizontally)
                 0xC8, // comscandec (use 0xC0 to flip vertically)
                 0xDA, (C.OLED_HEIGHT==64)?0x12:0x02,
                 0x81,extVcc?0x9F:0xCF, // set contrast
                 0xD9,extVcc?0x22:0xF1, // set precharge
                 0xDb,0x40, // set vcom detect
                 0xA4, // display all on
                 0xA6, // display normal (non-inverted)
                 0xAf // disp on
    var flipCmds = [0x21, // columns
         0, C.OLED_WIDTH-1,
         0x22, // pages
         0, (C.OLED_HEIGHT==64)?0x7:0x03];

    The only other issue I had with the module was a lack of support for a CS pin. Adding that would be nice.


Avatar for Chris @Chris started