Hopefully this new flash storage thing will open things up. At the very least you'll be able to put your WiFi credentials in setBootCode and have your code saved normally, but potentially we could also have a file for predefined variables that gets loaded automatically.
You probably know this, but if you do onInit() { wifi.on('connected', function() {}) } then each time onInit gets called (eg, if you save() twice) you'll get another handler. Just having the on('connected') outside onInit would be fine.
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.
Hopefully this new flash storage thing will open things up. At the very least you'll be able to put your WiFi credentials in
setBootCode
and have your code saved normally, but potentially we could also have a file for predefined variables that gets loaded automatically.You probably know this, but if you do
onInit() { wifi.on('connected', function() {}) }
then each time onInit gets called (eg, if yousave()
twice) you'll get another handler. Just having theon('connected')
outside onInit would be fine.