932 B
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
- Open the
basic
category and select theshow 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