save() does what it says: saving the code (status of the RAM) intoFllash. When you power-cycle, Espruino restores the code (loads the saved state) and invokes onInit() {...} or E.on("init",function(){...}) registered functions. Personally, I prefer the onInit(){...} because no matter of the code load sequence, I get the sequence I want.
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.
save()
does what it says: saving the code (status of the RAM) intoFllash. When you power-cycle, Espruino restores the code (loads the saved state) and invokesonInit() {...}
orE.on("init",function(){...})
registered functions. Personally, I prefer theonInit(){...}
because no matter of the code load sequence, I get the sequence I want.If you do not want to power-cycle, invoke/enter
onInit();
from with/in the console, and you get your code started. Read through this conversation about simple explanation how to save code that espruino run on start?.