Flashing Heart
Learn about the radio and LEDs in this activity!
Introduction
This project builds upon using the LED screen but introduces wireless communication between micro:bits!
Teacher Guide
Activity
7 steps
Step One
Place the show leds block in the on start block and draw a heart.
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .
`)
Step Two
Click Download to transfer your code in your micro:bit!
Step Three
Place another show leds block under the heart to make it blink.
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .
`)
basic.showLeds(`
. # . # .
# . # . #
# . . . #
. # . # .
. . # . .
`)
Step Four
Move the blocks inside the forever to repeat the animation.
basic.forever(function () {
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .
`)
basic.showLeds(`
. # . # .
# . # . #
# . . . #
. # . # .
. . # . .
`)
})
Step Five
Click Download to transfer your code in your micro:bit!
Step Six
Place more show leds blocks to create your own animation.
basic.forever(function () {
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .
`)
basic.showLeds(`
. # . # .
# . # . #
# . . . #
. # . # .
. . # . .
`)
basic.showLeds(`
. . . . .
. # . # .
. # # # .
. . # . .
. . . . .
`)
})
Step Seven
Click Download to transfer your code in your micro:bit!
Challenge
Try to add the following functionality:
- Send a written message to the second micro bit.
- Allow the user to choose a picture and send it to the other device
- Allow a third micro:bit to send and receive data
Learn More
Check out the 'Love Meter' lesson to learn about using the device's pins to control the screen.