New programming concepts
Sequence, pause, and loop
First show a large heart. Then show a small heart. Pause between them and repeat. Your eyes join the pictures together into a heartbeat.
Try it here
Change the heartbeat speed
How long should the program pause?
Pause: 500 milliseconds
MakeCode steps
Build the animation
- 1
- 2
Use the forever block
Your animation needs to repeat, so build the sequence inside the forever block.
- 3
Show the large heart
From Basic, add show icon and choose the large heart.
- 4
Pause for 500 ms
Add a pause (ms) block. Keep the number at 500. That is half a second.
- 5
Show the small heart
Add another show icon block and choose the small heart.
- 6
Pause again
Add another 500 ms pause. Test the complete sequence in the simulator.
forevershow icon ♥pause (ms) 500show icon ♥pause (ms) 500 - 7
Download and test
When the simulator works, transfer the program using the same steps as the Heart lesson.
Ready for one careful experiment?
Change both pauses to 1,000 ms. What changes? Then try 250 ms. Change one value at a time, observe, and explain the result.
Optional videos
Watch the official guides
The written steps above are complete. Videos are optional when the internet connection allows.
For the teacher
A calm 55-minute plan
Recall
Rebuild the single heart orally.
Unplugged animation
Alternate two paper heart pictures.
Guided build
Stop after each picture and pause.
Test and transfer
Use the simulator before USB.
One experiment
Change both pause values together.
Success criteria and accessibility note
A team succeeds if the two images repeat in the simulator and learners can point to the order. Do not require the word “iteration.” The page animation stops for people who request reduced motion; teachers should also warn learners who are sensitive to flashing lights.
Before you finish