Students name robot moves as functions (wiggle, spin) and build a dance routine by calling them in order, revisiting functions from micro:bit Foundations in a new setting.
Load these into Waypoints Prepare: choose Load URL and paste the copied address, or download the file and import it. In Prepare, the worksheet's Teacher edition shows the answers; the student copy hides them.
Predict and Run 7 min · Investigate 8 min · Modify 12 min · Make 15 min · Real robot 3 min (optional)
A function is a named group of blocks that runs when it is called. Students met functions in micro:bit Foundations (flashHeart); here each function is a move: a few motor blocks that end with robot motor stop. A routine is then a list of calls, which is easy to read and easy to change. The classic slip returns: making a function does nothing until something calls it (Leo's robot).
Functions are in Advanced › Functions (Make a Function…, then a call block appears). Each move should end with robot motor stop, or the next move starts from a moving robot. MOVE Motor classes can build the same moves from the Kitronik blocks with pauses.
Making a function doesn't move the robot; calling it does. When nothing happens, ask where the call block is.
| What you will see | A question to ask | The fix |
|---|---|---|
| Pressing the button does nothing. | Is there a call block inside the button event? | Drag call <your move> into on button … pressed. |
| The robot spins forever after the dance. | Does every move end with robot motor stop? | Add robot motor stop at the end of each function. |
| Moves blur into each other. | What happens between moves? | Add a short pause (basic pause 200 ms) at the end of a move for a beat between moves. |
One possible solution for each task. Other correct programs are fine.

function wiggle () {
robot.motorTank(50, -50, 300)
robot.motorTank(-50, 50, 300)
robot.motorStop()
}
function spin () {
robot.motorTank(50, -50, 1200)
robot.motorStop()
}
input.onButtonPressed(Button.A, function () {
wiggle()
wiggle()
})
input.onButtonPressed(Button.B, function () {
spin()
})
robot.elecfreaksCuteBot.start()

function wiggle () {
robot.motorTank(50, -50, 300)
robot.motorTank(-50, 50, 300)
robot.motorStop()
}
function spin () {
robot.motorTank(50, -50, 1200)
robot.motorStop()
}
input.onButtonPressed(Button.A, function () {
wiggle()
spin()
wiggle()
})
input.onButtonPressed(Button.B, function () {
spin()
})
robot.elecfreaksCuteBot.start()

function wiggle () {
robot.motorTank(50, -50, 300)
robot.motorTank(-50, 50, 300)
robot.motorStop()
}
function shuffle () {
robot.motorTank(50, 50, 300)
robot.motorTank(-50, -50, 300)
robot.motorStop()
}
function twirl () {
robot.motorTank(-50, 50, 1200)
robot.motorStop()
}
input.onButtonPressed(Button.AB, function () {
shuffle()
wiggle()
shuffle()
twirl()
})
robot.elecfreaksCuteBot.start()
Stretch: Add robot set color to each move so the lights change with the dance, or play a tone at the start of each move.
Support: Give students the shuffle function made; they make one more move and the A+B routine.
Why is a dance easier to change when each move is a function?
You change a move in one place, and every call to it in the routine changes too. The routine itself reads as a list of names.
Next unit: Sense. Later, lesson 8 uses radio so one micro:bit can cue several robots to dance together. Class idea: a short robot dance-off, with each group's routine read aloud as a list of move names first.