Flashing Heart
Introduction
Learn how to use the LEDs and make a flashing heart! (Want to learn how lights work? Watch this video).
Step 1
Place the ||basic:show leds||
block in the ||basic:forever||
block and draw a heart.
Step 2
Place another ||basic:show leds||
block. You can leave it blank and draw what you want.
basic.forever(function() {
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`);
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .`);
})
Step 3
Look at the virtual micro:bit, you should see the heart and your drawing blink on the screen.
Step 4
If you have a micro:bit connected, click |Download|
to transfer your code and watch the hearts flash!