Build a robot dance show to a tune in three milestones, from a moves library to a finale with an emergency stop.
Robot shows at theme parks and festivals are built like this: a library of moves, a soundtrack in sections, a cue for each section, and a stop button for safety.
Time to put the course together in a show. A conductor micro:bit plays a tune phrase by phrase and sends a cue as each phrase starts (lesson 8). Dancer robots do a move for each cue, and each move is a function with its own lights (lesson 2). You will build it in three milestones, with less help each time.
In the simulator, press A+B on the first micro:bit to start the show; the second robot dances.
Make your prediction first. Help opens once you've locked it in.

function wiggle () {
robot.setColor(0xff00ff)
robot.motorTank(50, -50, 300)
robot.motorTank(-50, 50, 300)
robot.motorStop()
}
function spin () {
robot.setColor(0x00ffff)
robot.motorTank(50, -50, 1200)
robot.motorStop()
}
function phraseA () {
radio.sendNumber(1)
music.play(music.stringPlayable("C C G G A A G - ", 120), music.PlaybackMode.UntilDone)
}
function phraseB () {
radio.sendNumber(2)
music.play(music.stringPlayable("F F E E D D C - ", 120), music.PlaybackMode.UntilDone)
}
input.onButtonPressed(Button.AB, function () {
phraseA()
phraseB()
})
radio.onReceivedNumber(function (receivedNumber) {
if (receivedNumber == 1) {
wiggle()
wiggle()
} else if (receivedNumber == 2) {
spin()
}
})
robot.elecfreaksCuteBot.start()
radio.setGroup(1)
Press A+B on the first micro:bit, with the sound on if you can.

function wiggle () {
robot.setColor(0xff00ff)
robot.motorTank(50, -50, 300)
robot.motorTank(-50, 50, 300)
robot.motorStop()
}
function spin () {
robot.setColor(0x00ffff)
robot.motorTank(50, -50, 1200)
robot.motorStop()
}
function phraseA () {
radio.sendNumber(1)
music.play(music.stringPlayable("C C G G A A G - ", 120), music.PlaybackMode.UntilDone)
}
function phraseB () {
radio.sendNumber(2)
music.play(music.stringPlayable("F F E E D D C - ", 120), music.PlaybackMode.UntilDone)
}
input.onButtonPressed(Button.AB, function () {
phraseA()
phraseB()
})
radio.onReceivedNumber(function (receivedNumber) {
if (receivedNumber == 1) {
wiggle()
wiggle()
} else if (receivedNumber == 2) {
spin()
}
})
robot.elecfreaksCuteBot.start()
radio.setGroup(1)

function wiggle () {
robot.setColor(0xff00ff)
robot.motorTank(50, -50, 300)
robot.motorTank(-50, 50, 300)
robot.motorStop()
}
function spin () {
robot.setColor(0x00ffff)
robot.motorTank(50, -50, 1200)
robot.motorStop()
}
function phraseA () {
radio.sendNumber(1)
music.play(music.stringPlayable("C C G G A A G - ", 120), music.PlaybackMode.UntilDone)
}
function phraseB () {
radio.sendNumber(2)
music.play(music.stringPlayable("F F E E D D C - ", 120), music.PlaybackMode.UntilDone)
}
input.onButtonPressed(Button.AB, function () {
phraseA()
phraseB()
})
radio.onReceivedNumber(function (receivedNumber) {
if (receivedNumber == 1) {
wiggle()
wiggle()
} else if (receivedNumber == 2) {
spin()
}
})
robot.elecfreaksCuteBot.start()
radio.setGroup(1)
Sort each part into its layer.
Think about where wiggle's blocks live.
Which layer of the show does each part belong to?
The show so far has one move, wiggle, and one phrase. Add two more moves:
Test each by calling it from wiggle's branch for a moment, then put wiggle back.
In Advanced › Functions, make a function called spin, and another called shuffle.
spin: set color, motor tank 50 −50 for 1200 ms, stop. shuffle: set color, forward for 300 ms, back for 300 ms, stop.
Add two moves to the library: spin and shuffle, each with its own lights and ending with a stop.
This ticks by itself when your blocks do what is asked.
Turn the moves into a show:
Twinkle's next phrases are F F E E D D C - and G G F F E E D -.
phraseB sends 2 and plays F F E E D D C -. phraseC sends 3 and plays G G F F E E D -.
Call the phrases in order on A+B. In on radio received, add else if branches for 2 (spin) and 3 (shuffle twice).
Three phrases, cues 1, 2 and 3, and a different move for each cue.
This ticks by itself when your blocks do what is asked.
Finish the show:
Then make it yours: change the tune, the moves or the colours.
A fourth phrase sends 4. A finale function changes colour several times as it moves, then stops and shows a picture.
The logo sends 0. In on radio received, an else at the end stops the robot and turns its lights off.
A finale on cue 4 with changing lights, and the logo sends a stop that every dancer obeys.
This ticks by itself when your blocks do what is asked.
For a class show, one micro:bit (not in a robot) conducts and every robot in its radio group dances. Practise on the real floor: moves that look right in the simulator often need longer or shorter times. A dancer finishes the move it is doing before it obeys the stop, so keep moves short. Real shows have a person whose only job is the stop button.
The performance challenge. Students build a robot show in three milestones (a moves library, three cued phrases, then a finale and a safety stop), combining functions, radio cues, music and decisions. About 60 minutes.
Open the teacher guide: answers, solutions, slides and a worksheet.
This is the performance strand's challenge, using lesson 2 (moves as functions), lesson 7 (radio numbers become moves) and lesson 8 (phrases send cues, then play until done). A show has three layers that change independently: moves (functions with lights), cues (phrase functions on the conductor) and the dancer's choice of move for each cue (on radio received).
The milestones fade the help: Milestone 1 names the moves and gives their steps, Milestone 2 gives an outline, Milestone 3 gives goals only. Each starter is the previous milestone's solution, so a student who is stuck can still move on. Showcase and Patrol and alert together mark the course Challenge complete.
In the simulator, two micro:bits and two robots appear; the conductor's own robot does not dance. A dancer finishes its current move before it obeys the stop cue (radio events wait their turn), so short moves make the stop feel quicker. The logo needs a micro:bit V2 (it shows in the simulator); with V1 micro:bits, use shake for the stop.
Keeping moves, cues and choices as separate layers. When a move never happens, ask which cue calls it and whether that branch checks the right number.
Stretch: Two parts: give dancers a role variable (lead or chorus) so the same cue makes different robots do different moves.
Support: Pair students: one writes the moves library, the other the phrases, then they agree the cue numbers.
Real-world links: theme-park animatronics, drone light shows, stage lighting desks with cue lists. For a class performance, assign each group a section of a longer tune.