led.on()

Category:Circuit Playground

Turns the red LED on.

Using led.on() will keep the red LED next to the USB on continuously. To turn it off, use led.off()

Examples

onBoardEvent("buttonL", "down", function(event) {
  led.on();
});

Toggle Switch

onBoardEvent("toggleSwitch", "open", function(event) {
  led.on();
});
onBoardEvent("toggleSwitch", "closed", function(event) {
  led.off();
});

Syntax

led.on()

Found a bug in the documentation? Let us know at documentation@code.org