Put pictures inside forever so they repeat, and use pause to set how long each one stays.
Scrolling signs at train stations and the lights on a pedestrian crossing run the same simple loop: show a picture, wait, show the next one, and start again.
Last lesson the blocks in on start ran once and the last picture stayed. A program has a second place to put blocks: forever.
Predict: Read the code and say what it will do before you run anything. A wrong guess is fine: it shows you what to look for.
Run: Run it and compare the result with your prediction.
Investigate: Trace how each line of code connects to what you see.
Modify: Change the code on purpose and check the result.
Make: Build something new using what you have learned. Expect a few tries; that is normal.
Make your prediction first. Help opens once you've locked it in.
PredictRead the code and say what it will do before you run anything. A wrong guess is fine: it shows you what to look for.
I can build an animation from pictures and pauses.
Before class
A program has two places to put blocks. on start runs its blocks once. forever runs its blocks again and again: a loop. Most surprises in this lesson come from which of the two a block is in. Try the Make yourself: three pictures in forever, one drawn with show leds.
Running the lesson
Predict: most students choose 'beating over and over'. Ask: which block are the hearts inside?
Run: the small heart stays. Last lesson's rule still holds: on start runs once.
Investigate: students fix Ada's program in the editor; the check ticks by itself. Take a vote on the pause question before anyone adds a pause.
Modify: then pause. 1000 ms is one second.
Make: small changes between frames look like movement. Let students show each other.
The hard part (on purpose)
on start runs once and forever repeats. When the heart doesn't beat, ask which block the pictures are inside.
When students get stuck
The heart does not beat after the fix. Ask: Which block are your hearts inside? Fix: Drag them inside forever, not under it. The block should hug them.
The animation flickers too fast to see. Ask: How long does each picture stay? Fix: Add a pause between pictures, such as 500.
A student thinks the program stopped after a pause. Ask: Watch for two more seconds. What comes after the pause? Fix: pause waits, then forever carries on from where it was.
Stretch and support
Stretch: Make an animation with five or more frames that tells a tiny story, such as a seed growing into a flower.
Support: Give students two show leds blocks already in forever, and ask them only to draw the pictures and add a pause.
Where it leads
Next lesson adds buttons, so the micro:bit waits for a press before it shows something. Class idea: each table designs one frame and the class joins them into one animation.
What each step is for
Investigate: Blocks inside forever run again and again: when the last one finishes, forever starts again from the top. pause holds a picture, then the loop carries on.
Modify: Every frame of an animation is one block in the loop, and pause sets how long each frame stays.