pxt-calliope/docs/reference/basic/show-leds.md
2016-06-11 22:28:57 -04:00

909 B

Show LEDs

Display an image on the BBC micro:bit's LED screen.

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

Parameters

  • leds is a String that shows which LEDs are on and off.
  • ms is an optional Number that shows how many milliseconds to wait after showing a picture. If you are programming with blocks, ms starts out as 400 milliseconds.

Example

Open the basic card in the Block Editor and select the show leds blocks.

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

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