993 B
993 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,msis 400 by default.
Example - Block Editor
- Open the
basiccategory and select theshow ledsblocks.
basic.showLeds(`
# # . # #
# # . # #
. # # # .
. # . # .
. # . # .
`
)
In JavaScript, the led off is represented by a . and the led on by a # character.
Lessons
smiley, flashing heart, magic logo