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);
@MaBe 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.
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: