led.on()

Category:Circuit

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

Toggle Switch

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

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

Syntax

led.on()

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