pxt-calliope/docs/reference/basic/show-leds.md
2016-04-15 16:15:08 -07:00

932 B

Show LEDs

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

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

Parameters

  • leds - a series of LED on/off states that form an image (see steps below)
  • (optional) ms - Number - time to wait after displaying image. In blocks, ms is 400 by default.

Example - Block Editor

  1. Open the basic category and select the show leds blocks.
basic.showLeds(`
    # # . # #
    # # . # #
    . # # # .
    . # . # .
    . # . # .
    `
)

In JavaScript, the led off is represented by a . and the led on by a # character.

Lessons

smiley, flashing heart, magic logo

See also

plot leds, show animation