Glad it's fixed now - it was remarkably strange behaviour.
Are you sure your code wasn't something nearer:
var x=false;
setInterval(function() {
x=!x;
LED1.write(x);
LED2.write(x);
}, 20);
In this case, you might expect it to take a few seconds before the lights blink at the right frequency. The internal hardware oscillator takes a few seconds before the frequency stabilises, but your code starts running before that point, so unless you delay, the initial timings can be off by quite a bit.
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, that'd be great.
Glad it's fixed now - it was remarkably strange behaviour.
Are you sure your code wasn't something nearer:
In this case, you might expect it to take a few seconds before the lights blink at the right frequency. The internal hardware oscillator takes a few seconds before the frequency stabilises, but your code starts running before that point, so unless you delay, the initial timings can be off by quite a bit.