pxt-calliope/docs/projects/flashing-heart.md
2016-06-10 23:10:00 -04:00

729 B

Use the LEDs to display a flashing heart.

Step 1

Use show leds and make your code look like this:

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

Step 2

Add a pause to wait and clear screen to turn off the LEDs.

basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`);
basic.pause(500);
basic.clearScreen();

Step 3

Put a forever loop around it.

basic.forever(() => {
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`);
basic.pause(500);
basic.clearScreen();
})