digitalWrite([LED1,LED2], 0) // both off
digitalWrite([LED1,LED2], 1) // LED2
digitalWrite([LED1,LED2], 2) // LED1
digitalWrite([LED1,LED2], 3) // LED1 + LED2
Basically if you put an array in then you can write the pins directly with a binary number - it's hugely useful for things like LED displays, where you might want to write values to several pins at once.
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.
Unless I'm missing something, this is all documented in the digitalWrite reference?
Basically if you put an array in then you can write the pins directly with a binary number - it's hugely useful for things like LED displays, where you might want to write values to several pins at once.