Alternates from turning the red LED on and off
Changes based on the current state of the LED. If the LED is on when you use led.toggle()
, then it will turn off after being called.
onBoardEvent(buttonL, "down", function(event) { led.toggle(); });
led.toggle()
Found a bug in the documentation? Let us know at documentation@code.org