Ok, no problem. Obviously it takes a while for me to write that code for you, and I can't afford to keep doing that for folks that aren't using official boards :) I'll move this to the 'General' other boards section.
Some obvious stuff I notice:
Calling power("on") twice will set up 2 intervals - so you need to either only call setInterval once at the start, or make sure that power("off") clears the interval
E.on('init', onInit()); is broken - just remove that line
save() shouldn't be on the right-hand side of the IDE, it could cause problems
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.
Ok, no problem. Obviously it takes a while for me to write that code for you, and I can't afford to keep doing that for folks that aren't using official boards :) I'll move this to the 'General' other boards section.
Some obvious stuff I notice:
power("on")
twice will set up 2 intervals - so you need to either only call setInterval once at the start, or make sure thatpower("off")
clears the intervalE.on('init', onInit());
is broken - just remove that linesave()
shouldn't be on the right-hand side of the IDE, it could cause problems