I fixed the code so it runs out of the box now - I had just omitted the definitions for the ledpin1/ledpin2 variables because I was illustrating how to write the code (just like how in the Arduino example, I didn't include definitions for the LED pins).
I also missed the second argument to digitalWrite() in one case.
Note that sometimes when copy/pasting code from these forums, it inserts non-printing junk characters. These get red-marked in the IDE, remove them where they appear.
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.
I fixed the code so it runs out of the box now - I had just omitted the definitions for the ledpin1/ledpin2 variables because I was illustrating how to write the code (just like how in the Arduino example, I didn't include definitions for the LED pins).
I also missed the second argument to digitalWrite() in one case.
Note that sometimes when copy/pasting code from these forums, it inserts non-printing junk characters. These get red-marked in the IDE, remove them where they appear.