where is the code that I uploaded stored in the Puck?
RAM, unless you type save() on the left-hand side, or choose save on send in the IDE.
Cause I noticed that everything that I have uploaded seems to be lost once I take the battery out
Yes, just type save() on the left-hand side and it'll resume in the same state at power on. Create a function called onInit() first if you want something to be called at boot.
function ... Is it overwritten or appended to the end?
If you send function foo() {...} it'll overwrite any existing function with that name, or will create a new function if one didn't exist. If you send normal commands like digitalPulse then they'll be executed and then forgotten.
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.
RAM, unless you type
save()
on the left-hand side, or choosesave on send
in the IDE.Yes, just type
save()
on the left-hand side and it'll resume in the same state at power on. Create a function calledonInit()
first if you want something to be called at boot.If you send
function foo() {...}
it'll overwrite any existing function with that name, or will create a new function if one didn't exist. If you send normal commands likedigitalPulse
then they'll be executed and then forgotten.