f4aa25e2bd
* Modify tutorials for single dl step * Some more fixes * coin flip typer
1.5 KiB
1.5 KiB
Flashing Heart
Step 1
Place the ||basic:show leds||
block in the ||basic:on start||
block and draw a heart.
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`
);
Step 2
Place another ||basic:show leds||
block under the heart to make it blink. Check in the simulator to see the heart blink.
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`);
basic.showLeds(`
. # . # .
# . # . #
# . . . #
. # . # .
. . # . .`);
Step 3
Move the blocks inside the ||basic:forever||
to repeat the animation.
basic.forever(() => {
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`
);
basic.showLeds(`
. # . # .
# . # . #
# . . . #
. # . # .
. . # . .`);
})
Step 4
Place more ||basic:show leds||
blocks to create your own animation.
basic.forever(() => {
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`
);
basic.showLeds(`
. # . # .
# . # . #
# . . . #
. # . # .
. . # . .`);
basic.showLeds(`
. . . . .
. # . # .
. # # # .
. . # . .
. . . . .`);
})
Step 5
If you have a @boardname@ connected, click |Download|
to transfer your code and watch the hearts flash!