You are reading a single comment by @MaBe and its replies. Click here to read the full conversation.
  • I guess you use the WEBIDE and upload your code, so the time between writeTo and readFrom is different.

    To make it equivalent put your code in a function and use setTimeout() to call it.

    eg:

    I2C1.setup({ sda: D4, SCL: D5 });
    
    function i2c_do(i2c,addr, w,r){
        i2c.writeTo(addr, w);
        i2c.readFrom(addr,r);
    }
    
    setTimeout(function(){i2c_do(I2C1,0x11,0­,2);},1000);
    
    
About

Avatar for MaBe @MaBe started