This is expected behaviour. If you want to force LED1 on at startup, do:
function onInit() {
LED1.write(1);
}
save();
I'd been considering saving pin state, but I'm not sure if it's such a good idea as often connected devices will actually need more complex initialisation done to them than just setting pin state back exactly as it was. I think very often it's actually better to force people to explicitly set the pin state.
I'd be interested to hear what everyone thinks though.
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.
This is expected behaviour. If you want to force LED1 on at startup, do:
I'd been considering saving pin state, but I'm not sure if it's such a good idea as often connected devices will actually need more complex initialisation done to them than just setting pin state back exactly as it was. I think very often it's actually better to force people to explicitly set the pin state.
I'd be interested to hear what everyone thinks though.