Look at the onInit(){...} function and on its purpose. Place the startup code in it, upload the code again - it will (should) do nothing application-wise - and enter save() in the console... and you are done (save() is saving the code into FLASH from where Espruino will pick it up at the end of saving and on every power-up to com). Powering on the device in disconnected mode will call the onInit() as the last thing of startup.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Look at the
onInit(){...}
function and on its purpose. Place the startup code in it, upload the code again - it will (should) do nothing application-wise - and entersave()
in the console... and you are done (save()
is saving the code into FLASH from where Espruino will pick it up at the end of saving and on every power-up to com). Powering on the device in disconnected mode will call theonInit()
as the last thing of startup.