Espruino Pico onInit problem #4672
Replies: 1 comment
-
Posted at 2018-08-19 by @allObjects After upload, did you a) run it and then save it? - or b) save it right away? Save will after completion call onInit, can you verify that? I 'm sure you already worked through the Troubleshooting section... Posted at 2018-08-19 by Pinnchus After upload, did you a) run it and then save it? - or b) save it right away? Save will after completion call onInit, can you verify that?
if force the running mode with load(), works ok...
I 'm sure you already worked through the Troubleshooting section... Thanks for your help. Posted at 2018-08-19 by Pinnchus This is the full code Attachments: Posted at 2018-08-19 by Pinnchus Looking further, The problem apparently lies in the initialization of SSD1306. Posted at 2018-08-19 by Pinnchus if I plug the USB, connect the IDE and execute "g = require("SSD1306").connect(i2c, start, { height : 32 });" from the console the display update all the information. Looking further to understand why... Posted at 2018-08-19 by Pinnchus OK, i found it. This SSD1306 module, apparently, need at least 1.5 seconds to stabilize. Posted at 2018-08-20 by @allObjects Ic... you try to use it too early and then it fails.... this 1.5+ secs is probably to initialize all its components. Posted at 2018-08-20 by @gfwilliams
Glad it's working now - so was the issue that you were calling Posted at 2018-08-21 by @allObjects 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 PS: ...could it be that Without knowing all the details, I would give this restructured code a shot:
Posted at 2018-08-21 by Pinnchus I will try to clean the code, and trace the call´s order, and come back again tomorrow. But basically the call to start is in the require(ssd1306) callback. Thanks for your help. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2018-08-18 by Pinnchus
I think a my be doing something wrong, when run the code from the IDE, everything runs fine. But, when i try to save the code, wrapping the initialization code in a function and calling it from the onInit function does not run unless I call it manually with load(). When I run manually load() everything runs fine too.
The code is uggly, but it's working when i run it manually.
Does anyone has a hint?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions