Avatar for user54159


Member since Apr 2015 • Last active Nov 2018
  • 3 conversations

Most recent activity

  • Avatar for user54159

    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.

  • Avatar for user54159

    OK, i found it. This SSD1306 module, apparently, need at least 1.5 seconds to stabilize.

  • in Pico / Wifi / Original Espruino
    Avatar for user54159

    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...

  • in Pico / Wifi / Original Espruino
    Avatar for user54159

    Looking further, The problem apparently lies in the initialization of SSD1306.

  • in Pico / Wifi / Original Espruino
    Avatar for user54159

    This is the full code

  • in Pico / Wifi / Original Espruino
    Avatar for user54159

    After upload, did you a) run it and then save it? - or b) save it right away?
    I have tried both options.

    Save will after completion call onInit, can you verify that?
    Yes it does, in fact while connected it works very well. The problem happens when I connect it without a console, but in the code I do not have any call to write to the console.

    Compacting Flash...
    Calculating Size...
    Compressed 81600 bytes to 19967
    Running onInit()...

    if force the running mode with load(), works ok...

    Loading 20034 bytes from flash...
    Running onInit()...

    I 'm sure you already worked through the Troubleshooting section...
    Yes I did but without success.

    Thanks for your help.

  • in Pico / Wifi / Original Espruino
    Avatar for user54159

    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.

    //All VAR are declared globally
    function initializeall() {
      i2c = new I2C();
      i2c.setup({ scl : B6, sda: B7, bitrate: 1000000  });
      g = require("SSD1306").connect(i2c, start, { height : 32 });
      dht = require("DHT22").connect(B5);
      setWatch(selection, B15, { repeat: true, edge:'falling', debounce:20});
      setWatch(BtnUP, B14, { repeat: true, edge:'falling', debounce:20});
      setWatch(BtnDown, B13, { repeat: true, edge:'falling', debounce:20});
    function onInit() {
      setTimeout(function () {

    Does anyone has a hint?