• I do not exactly know, but there something run after your E.on('init',yourAnonymousFunction(){}) that needs the time of 1500+ ms. I usually do not use the E.on('init',...), because it does not full control over what is initialized when, even though in your case it is just one registered (user) function. I use the 'old' onInit() {...} that was always there... and I would be very surprised that that would not run anymore... (@Frida has it in the code... commented: @Frida, did it work for you with old onInit()?)

    function ledInit() {
      digitalPulse(LED1,1,200);
      digitalPulse(LED2,1,400);
    }
    
    function onInit() {
        USB.setConsole();
        console.log('ini');
        ledInit();
        setTimeout(ledInit,2000);
    } // end onInit()
    // onInit();  remove or comment before uploading last time  before save()
    

    If it is not working, the console meddling could could have something to do with it...

    Important (for my use is), that I never save() dynamic initialized values or running timers..., not even watches, even though @Gordon built it the way that it - saving the state of the interpreter, configurations, timers,... are saved and restored on power up - works (...for simple things where no timing issues loom...). Sometimes I take even the port mode settings out of the upload code and put it into the initialization code...

About

Avatar for allObjects @allObjects started