Make it autonomous

Posted on
  • Hi,

    After loading my code on the Espruino Pico, i'd like to makeit work by plugging it in a standard plug (as used to charge smartphones).
    Loaded my code, unplugged the espruino from my computer and plugged it on the wall but i can't get the code to run (it s supposed to generate a melody)
    Is the espruino flashed when powered off or did i miss something ?
    Thanks for your answer

  • Hello :)

    Try to use the save function.

    function onInit()  {
      playMelody();
    }
    

    Upload to Espruino, then in the right hand side; type save() and press Enter.
    You Espruino should now playMelody() each time it's powered on!

  • It works like a charm !
    Thank you very much :)

  • Hmmm. This didn't work for me.

    I tried plugging it in to a wall charger and doesn't work. However when I hit the connect button on the WebIDE the program starts...

  • I updated the firmware (I guess it doesn't matter which one because I'm not using wifi) and then flashed, saved, and ejected it. I then plugged it in to the plug, the red LED flashed for a short time and then the program kicked in about a second or two later. :)

  • Great - glad you got it sorted!

    Yes, you can use any firmware if you don't care about networking.

    There's a ~1 sec delay in the Pico so you can hold down the Button to stop it loading the saved program. At some point I'll make an option to remove that so you can have a properly fast boot up.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Make it autonomous

Posted by Avatar for Etienne @Etienne

Actions