Avatar for user54159

user54159

Member since Apr 2015 • Last active Oct 2018
  • 3 conversations
  • 24 comments

Most recent activity

  • in Pico / Wifi / Original Espruino
    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.

  • in Pico / Wifi / Original Espruino
    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...
    Writing..
    Compressed 81600 bytes to 19967
    Running onInit()...
    

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

    >load()
    =undefined
    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() {
      require("Font6x8").add(Graphics);
      require("Font8x16").add(Graphics);
      i2c = new I2C();
      i2c.setup({ scl : B6, sda: B7, bitrate: 1000000  });
      g = require("SSD1306").connect(i2c, start, { height : 32 });
      dht = require("DHT22").connect(B5);
      Start_read();
      pinMode(B15,'input_pullup');
      pinMode(B14,'input_pullup');
      pinMode(B13,'input_pullup');
      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() {
      USB.setConsole(true);
      setTimeout(function () {
                    initializeall();
                    }, 
          1000);
    }
    

    Does anyone has a hint?

    Thanks

  • in Projects
    Avatar for user54159

    Hi, there is any simple way to scroll text in a 32x8 Led Matrix with MAX7219 controller? Any help will be appreciated.

    Thanks and regards

Actions