Connect I2C Oled display to MDSB42Q?

Posted on
  • Hello,
    I'm trying to connect an Oled to my MDSB42Q - so it show messages on connect\disconnect

    var i2c = new I2C();
    i2c.setup({ scl : D20, sda: D19 });
    
    

    is the setup OK?
    and how do I send to him text
    is there a library to download \ use?

    Thanks ,

  • The code there is ok for setting up I2C on the MDBT42Q, but without knowing anything about your OLED it's hard to help you.

    Espruino has some libraries to connect to common OLED displays though, so if you have one of them ( https://www.espruino.com/Search?kw=oled ) then all you have to do is use the instructions and code there

  • I'm using this device
    128×64 OLED display module (SSD1306) , I will try

    just to be ready
    if I take the code:

    function start(){
     // write some text
     g.drawString("Hello World!",2,2);
     // write to the screen
     g.flip();
    }
    
    // I2C
    I2C1.setup({scl:B6,sda:B7});
    var g = require("SSD1306").connect(I2C1, start);
    

    it's should work ?
    will change it to print if someone is connected or not

    Thanks ,

  • Yes, that should work based on https://www.espruino.com/SSD1306 - but obviously you'll want to change the pin numbers to the pins you have used.

    You could also try:

    // ...
    var i2c = new I2C();
    i2c.setup({ scl : D20, sda: D19 });
    var g = require("SSD1306").connect(i2c, start);
    

    which uses software I2C - either should work

  • Obviously :-)

    it's working

    thanks,

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Connect I2C Oled display to MDSB42Q?

Posted by Avatar for David1234321 @David1234321

Actions