Tried to look at your uploaded compete code 'Fermentadora'... but don't kow how to look at it.
I though did lookup the SSD1306 module and I found that the .connect(...) accepts a callback function as second argument... and when using this callback to call your code that has to be executed afterwards, it should time just right! (The module does internally already a lot of setTimeout(...) to manage timing... for you... when using the callback. If it still does not work, the times used in these setTimeout(...) should be adjusted in the module.)
PS: ...could it be that start in connect should be something like the Start_read()?
Without knowing all the details, I would give this restructured code a shot:
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.
Tried to look at your uploaded compete code 'Fermentadora'... but don't kow how to look at it.
I though did lookup the SSD1306 module and I found that the
.connect(...)
accepts a callback function as second argument... and when using this callback to call your code that has to be executed afterwards, it should time just right! (The module does internally already a lot ofsetTimeout(...)
to manage timing... for you... when using the callback. If it still does not work, the times used in thesesetTimeout(...)
should be adjusted in the module.)PS: ...could it be that
start
in connect should be something like theStart_read()
?Without knowing all the details, I would give this restructured code a shot: