Autonomous Espruino

Posted on
  • I am sure this is possible, as many of the examples assume that the Espruino board is stand-alone.

    I have searched these forums (unsuccessfully) and the Espruino website (even more unsuccessfully) and simply cannot find details on how to load code on to the board so that it starts automatically, irrespective of whether the board is connected to a computer or not.

    I am ready to be embarrassed about how simple this process is ...

  • OK - so I completely missed save(). Oops!

    So, save() stores the program and variables in memory. That works. If I reset the board and then run dump(), it's all there.

    What is not clear is how I get the board to start the program on power up (as opposed to pressing the reset).

  • Ahh... for that, just create a function called onInit, then save, and it will be called right after all the rest of the code is loaded.

  • @Gordon Is the oninit usage described somewhere? I notice it on examples only and it is mentioned once in Reference as a "workarround" for internal function issues (when called during starup)...
    Thanks
    Bogdan

  • It's only at the bottom of http://www.espruino.com/Quick+Start at the moment.

    Do you have suggestions for where I could put more information where people could find it easily?

  • Hi Gordon,

    Maybe on the referencepage where you documented "reset()".

    Sacha

  • Good idea - thanks :)

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

Autonomous Espruino

Posted by Avatar for uberboffin @uberboffin

Actions