I'm also struggling with the save()/restore() stuff. I would like the following set-up:
I have some "environment variables", such as wifi password, save()'ed in a couple fo global variables.
I have a program in the IDE that I'd like to upload and run (using the 1-click button) and make use of these variables
I need the IDE to issue a reset() because otherwise there are timers and other crap left from the previous iteration
I can't figure out how to make this work. When the IDE does a reset() the saved variables are not loaded. The environment is literally empty. I tried to use load() at the start of my file, but it causes a reset also, and seems to have a pile of side-effects on the parsing of the remainder of the file. Any ideas?
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.
I'm also struggling with the save()/restore() stuff. I would like the following set-up:
I can't figure out how to make this work. When the IDE does a reset() the saved variables are not loaded. The environment is literally empty. I tried to use load() at the start of my file, but it causes a reset also, and seems to have a pile of side-effects on the parsing of the remainder of the file. Any ideas?