The only problem you have is that when the setTimeout fires, it doesn't automatically set timer to undefined.
setTimeout
timer
If you did:
timer = setTimeout(function () {// trigger relay: OFF timer = undefined; ....
it would probably fix it?
@Gordon started
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.
The only problem you have is that when the
setTimeout
fires, it doesn't automatically settimer
to undefined.If you did:
it would probably fix it?