Thanks for sending over the code. The pulldown mode seems reasonable (as long as you don't have a normally-closed switch that's constantly pulling against it!). Also you'd see LED1 (your sleep indicator LED) blinking if you had something waking the WiFi up.
Please could you ensure that you've uploaded your code to Flash? That might be your issue.
But basically: When you save to RAM the code executes right away, and when you then run save() Espruino effectively 'hibernates', writing the current state of the interpreter to flash and reloading it at boot.
The issue here is that because it knows that A13 is a pin that's used internally by WiFi, Espruino WiFi may not save the state of that pin for you, so after the initial upload the A13.read() command may not have an effect.
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.
Thanks for sending over the code. The pulldown mode seems reasonable (as long as you don't have a normally-closed switch that's constantly pulling against it!). Also you'd see LED1 (your sleep indicator LED) blinking if you had something waking the WiFi up.
Please could you ensure that you've uploaded your code to
Flash
? That might be your issue.Either that or add:
There's some info on http://www.espruino.com/Saving
But basically: When you save to RAM the code executes right away, and when you then run
save()
Espruino effectively 'hibernates', writing the current state of the interpreter to flash and reloading it at boot.The issue here is that because it knows that A13 is a pin that's used internally by WiFi, Espruino WiFi may not save the state of that pin for you, so after the initial upload the
A13.read()
command may not have an effect.