• Thank you @MaBe
    That gave me the values I was looking for. I knew that all that needed to change the values of the initCmds variable from the original 1306 module http://www.espruino.com/modules/SSD1306.­js
    There was also the initCmds[15] change when initializing that I needed to update. My new driver can be found at: https://github.com/bocajs/NodeBotDays/bl­ob/master/Espruino/ssd1306.js

    The working code from: https://github.com/bocajs/NodeBotDays/bl­ob/master/Espruino/oled.js

    function start(){
      g.clear();
      g.drawString("Hello",35,0);
        g.drawLine(35, 20, g.getWidth(), 20);
      g.setFontVector(10);
      g.drawString("1234567890",20,7);
      g.drawString("1234567890",20,22);
      g.drawString("1234567890",20,35);
      g.flip();
    }
    
    // HELTEC 128x32
    /*
    let SCL = D5;
    let SDA = D4;
    I2C1.setup({scl:SCL,sda:SDA});
    var g = require("ssd1306").connect(I2C1, start, { height : 32 });
    */
    
    //D1.Mini OLED 64x48
    let SCL = D1;
    let SDA = D2;
    I2C1.setup({scl:SCL,sda:SDA});
    var g = require("https://raw.githubusercontent.c­om/bocajs/NodeBotDays/master/Espruino/ss­d1306.js").connect(I2C1, start, { height : 48 });
    
    

    BUT...
    As you can see from the code. I did NOT change the width. I left it at 128. INSTEAD of 64.
    Everything is shifted over to the left. so to make the text be lined up I have to start it as if it's 30 pixels to the RIGHT.

    What value could be causing this?

About

Avatar for fanoush @fanoush started