pxt-calliope/docs/reference/basic/show-leds.md
Sam El-Husseini e3975e65e5 pxt-microbit Accessibility PR (#529)
* Accessibility changes
2017-09-07 13:42:08 -07:00

883 B

Show LEDs

Shows a picture on the LED screen.

basic.showLeds(`
    . . . . .
    . # . # .
    . . # . .
    # . . . #
    . # # # .
    `
)

Parameters

  • leds is a string that controls which LEDs are on and off.
  • interval is an optional number that means how many milliseconds to wait after showing a picture. If you are programming with blocks, interval is set at 400 milliseconds.

Example

This program shows a picture with the show leds function.

basic.showLeds(`
    # # . # #
    # # . # #
    . # # # .
    . # . # .
    . # . # .
    `
)

~hint

If you are programming in JavaScript, # means an LED that is turned on and . means an LED that is turned off.

~

See also

plot leds, show animation