"save code to RAM" to "save directly to flash" and then back to RAM
You may find that you now have your 'old' code stored in flash memory as well as new code - you can remove that with reset(true).
It might help to see http://www.espruino.com/Saving - when saving the contents of RAM (the default) Espruino saves the state of IO (digitalWrite/pinMode/etc) but not the state of PWM.
Probably what you want is to call analogWrite(B4, 0.1); from a function called onInit, so that it is run automatically at boot.
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.
You may find that you now have your 'old' code stored in flash memory as well as new code - you can remove that with
reset(true)
.It might help to see http://www.espruino.com/Saving - when saving the contents of RAM (the default) Espruino saves the state of IO (digitalWrite/pinMode/etc) but not the state of PWM.
Probably what you want is to call
analogWrite(B4, 0.1);
from a function calledonInit
, so that it is run automatically at boot.