Challenge 1
Show all four faces in one show. End on the face you started with. Every change must be hidden. Judge it from where the audience sits, not from above. If anyone watching sees a card turn, it does not count.
Quick Learn — the model, the instructions, the program and the challenges. The theory is in Full Lesson.
EV3 Robotics›Level 2 · Intermediate›Lesson 2
Level 2 · Lesson 2 · EV3-L02-0260 minutes · Ages 8+ · Model: Speed Face Change
The Speed Face Change: four painted faces on a turntable, and a white screen that drops in front of them. The screen comes down. The faces turn. The screen goes up. Now the people watching see a new face, and they have no idea how!
It is a magic trick made with two motors. It only works if they take turns.
Many Level 1 models needed two motors moving together, in step. Think of the Frog, the Toddle Bot, the Push-up Robot and the cars. This one is the opposite. If both motors move at once, people see the face turn. Then the trick is over.
Bian lian means face-changing. It is a kind of opera show from Sichuan in China. It is three hundred years old. A performer sweeps a fan or a sleeve across their face. The painted mask changes colour straight away. It happens again and again, faster than your eye can follow.

The secret is thin silk masks, one on top of another. The performer pulls threads to take them off. But what matters to you today is how the trick is done. The change is always hidden behind something. A fan, a sleeve, a turn of the head. Never out in the open.
The skill is not changing the mask fast. It is making very sure the cover is in place before the change starts. The cover must stay there until the change is done. Performers keep the secret so well that China protects it by law as a national secret.
Get the timing even a little wrong, and there is no trick. People just watch you change a mask. That is not magic. It is somebody fiddling with their face!
And it fails all the way, not just a bit. A trick that is 90 % hidden has still given the secret away.
Cover first. Change second. Uncover third. Any other order spoils the trick.
Two motors do two different jobs. The order they go in is what makes the machine work.
You already know a program does one thing after another. Blocks run down the page, top to bottom. What is new is that now this is the point. In Level 1, Lessons 24 to 32, you worked hard to get two motors moving at the same moment. Here you want the opposite. A plain stack of blocks does it for you, with no extra work.
| Kind of job | How to write it |
|---|---|
| Two motors doing one job (legs, wheels, arms) | A move block on a pair. Both at once, in step. |
| Two motors doing two jobs (screen, turntable) | Two run blocks, one after the other. Each one waits for the last one to finish. |
Here is why a plain stack works. A run for (90) degrees block waits until it has finished. That same thing made the Push-up Robot get stuck in Level 1, Lesson 32. Here it is just what you want. The screen will always be all the way down before the faces start to turn.
Blocks in a stack take turns on their own. When two motors must not move together, that is not a problem. It is just what you need.
The Medium Motor is the smaller of the two EV3 motors. It is quick and light rather than strong, which makes it the right choice for anything that has to move a part of the robot rather than the whole robot — a gate arm, a pair of jaws, a winch, a pointer.
| Block | What it does |
|---|---|
[A v] run [clockwise v] for (1) [rotations v] :: motors | Turns the motor a measured amount, then stops. One rotation is one full turn of the motor shaft. |
[A v] run [clockwise v] for (90) [degrees v] :: motors | The same idea, but in degrees — useful when a quarter or a half turn is what the mechanism needs. 360 degrees is one rotation. |
[A v] run [clockwise v] for (2) [seconds v] :: motors | Turns the motor for a length of time and then stops, whatever the shaft managed to do in it. The one measurement that always finishes. |
[A v] set speed to (50) % :: motors | Sets how fast the motor will run from now on. It does not start the motor by itself. |
[A v] start motor [clockwise v] :: motors | Starts the motor turning and moves straight on to the next block. It keeps going until something stops it. |
[A v] stop motor :: motors | Stops the motor. |
These two look similar and behave completely differently, and almost every early EV3 bug comes from picking the wrong one. Watch both run the same job, over and over.
versus
Let it loop a few times. The left dial keeps landing on the same mark; the right one leaves a new mark almost every run — that scatter is what “not repeatable” means.
The black mark is where the shaft should finish. The measured motor hits it every single run, because the program waits at that block until the motor has turned exactly that far. The timed motor is only running for a second — and a second covers a different amount depending on the battery, the friction and whatever the mechanism is carrying. Each orange dash is a run that finished somewhere it was not asked to.
If a mechanism has to end up in a particular place — a gate that must finish upright, a jaw that must close fully — use the measured block.
The dropdown at the end of the run block has a third setting, and it is the one that saves lifting mechanisms. for () seconds switches the block off a distance and onto a duration: it drives the motor for that long and then stops, whatever the shaft managed to do in the time.
That sounds strictly worse than a measured turn, and for most jobs it is. It matters because of what the measured block actually waits for. run for (90) degrees does not finish when 90 degrees’ worth of time has passed. It finishes when the shaft has turned 90 degrees — and if the mechanism runs out of travel first, the shaft never will.
Every arm, jaw and lift has a physical limit: a point where the mechanism reaches the top of its travel, or something in the build gets in the way. Push a motor into that limit and it stalls — the shaft stops turning and the motor sits there straining. The motor is fine and the program is spelled correctly. But the encoder has stopped counting, so a measured block that was told a bigger number is still waiting, and it will wait until the Brick is switched off.
Nothing after that block ever runs. Not the next motor block, not the sound, not the display, not the rest of the program. That is the whole failure, and it looks like a crash even though nothing has crashed.
when program starts :: events hat [A v] set speed to (30) % :: motors [A v] run [clockwise v] for (90) [degrees v] :: motors [A v] reset degrees counted :: motors write [HOME SET] at line (1) :: display
Watch the Brick screen, not the arm. HOME SET is the block after the motor block, so a blank screen means the program never got past it.
Compare the first two. The only difference between them is 45 and 90, the mechanism is identical, and one of them is a working program while the other locks up on the third block. Nothing in the listing distinguishes them — the end stop is a fact about the build, and the program has never heard of it.
This is the mistake almost every student makes the first time a Medium Motor lifts something. A lifting arm has a lowest position and a highest one; ask it to turn past either and the program hangs. It is worse than an ordinary bug, because the robot looks alive — the motor is still being driven, still buzzing, still hot — and the next block never comes.
The fix turns the problem into the technique. You often do not know how many degrees it is to the top of an arm’s travel — it depends on the build, and it changes the moment somebody rebuilds it. So do not measure it. Drive the arm gently into its own end stop for a couple of seconds, and then declare that position to be zero:
when program starts :: events hat [A v] set speed to (30) % :: motors [A v] run [counterclockwise v] for (2) [seconds v] :: motors [A v] reset degrees counted :: motors write [HOME SET] at line (1) :: display
Three things make that work, and all three are deliberate:
After that, use measured blocks for everything inside the travel and timed blocks whenever you are driving to a limit. The rule of thumb: if the movement ends against something solid, run for seconds.
A Medium Motor is normally plugged into port A or D, which leaves B and C free for the Large Motors that drive wheels. The letter in the block must match the port the cable is actually in — this is the single most common reason a program appears to do nothing at all.
The Large Motor is the bigger of the two EV3 motors. It turns more slowly than the Medium Motor but pushes far harder, which is why it drives wheels and lifts loads. If a mechanism struggles or stalls with a Medium Motor, this is usually the answer.
| Block | What it does |
|---|---|
[B v] run [clockwise v] for (3) [rotations v] :: motors | Turns the motor a measured amount, then stops. |
[B v] run [clockwise v] for (2) [seconds v] :: motors | Turns it for a length of time rather than a distance, then stops — however far the shaft actually got. |
[B v] set speed to (40) % :: motors | Sets how fast the next movement will be. |
[B v] start motor [clockwise v] :: motors | Starts it turning and carries straight on. |
Give both motors the same program and the same arm. With nothing on the arm the Medium Motor wins easily — which is why it is tempting to treat it as simply the better motor. Then the demo hangs a weight on both arms and runs it again.
and on the Large Motor, only the port changes
Turning the speed up would not rescue the Medium Motor here — a stalled motor needs more force, which means gearing it down or using the Large Motor.
That is the whole difference. The Medium Motor is quicker; the Large Motor is stronger. A motor that cannot produce enough force does not move slowly — it stops altogether and strains, which is the buzzing, going-nowhere failure almost every LEGO builder meets sooner or later.
Being stronger buys the Large Motor a bigger load, not an infinite one. Every winch runs out of cable and every lift reaches the top of its rails, and when a motor arrives at a limit it stalls: the shaft stops turning and the motor sits there straining.
That is a problem for the program, not just the mechanism. run for (3) rotations does not finish when three rotations’ worth of time has gone by — it finishes when the shaft has actually turned three times. A winch that reaches the top after two and a half will never report three, so the block waits, and every block after it is unreachable. Nothing crashes. The motor keeps pushing and the rest of the program simply never happens.
The third setting in that dropdown is the way out. for () seconds drives the motor for a duration and then stops regardless, so it always finishes and the program always moves on. Drive into a limit slowly, for a comfortably long time, and then call that position zero:
when program starts :: events hat [B v] set speed to (30) % :: motors [B v] run [counterclockwise v] for (3) [seconds v] :: motors [B v] reset degrees counted :: motors
The lift ends up against its own stop, the encoder is zeroed there, and every measured move afterwards starts from a place you know. The rule is the same for both motors: if the movement ends against something solid, run for seconds; if it ends somewhere in the middle, measure it. The Medium Motor module has the animation for it — see The Medium Motor, which is where this bites hardest, because a Medium Motor is usually the one doing the lifting.
The blocks are identical apart from the port letter, so swapping one motor for the other is a build change, not a programming change.
Real machines match the motor to the load. A lift uses a powerful, slow motor; the button panel beside it uses tiny ones. Choosing the wrong size is the most common reason a LEGO mechanism whines but does not move.
Say this back before moving on: “A measured motor block finishes before the next one starts. That is how they take turns.”
Three parts with cables. This is the first model in the course with one of each motor.
| Part | What it is doing here |
|---|---|
| EV3 Intelligent Brick | Runs the program and holds the whole model up. |
| Medium Motor, port A | Lifts and drops the white screen. It is light and quick. A screen that drops slowly gives the trick away. |
| Large Motor, port D | Turns the card holder a quarter turn at a time. It is strong, because it swings four cards on an arm. |
This model does not work straight from the box. The manual asks you to make the paper parts yourself. Without them, there is nothing to show.
Sensors go in ports 1, 2, 3, 4. Motors go in ports A, B, C, D. You cannot swap them. If you do, nothing warns you. The robot just will not work.
There is a second rule too. Today you will see why. B and C are for a pair. Two motors doing one job together go there. Think of the Frog’s legs, the Tricycle’s wheels, or the Push-up Robot’s arms. Two motors doing different jobs go in A and D instead.
| Part | Port | Why this one |
|---|---|---|
| Medium Motor (the screen) | A | One motor with a job of its own goes in A. It did in most of Level 1. |
| Large Motor (the turntable) | D | The other job goes in D. It skips B and C on purpose. Then nobody is tempted to run these two as a pair. |
| Sensors | none | The machine cannot check that the screen is really down. It trusts the order of the blocks. |
Check your own build now:
Two routes, and either is fine. USB is the reliable one and the one to fall back on when a room’s Bluetooth is busy; Bluetooth leaves the robot free to move, which some models need.
Do these in order. Naming the Brick after you go looking for it in the list is how groups end up driving each other’s robots.
EV3 until somebody changes it.EV3.The two failures, every class, every time. The Brick has gone to sleep while you were building — press the centre button to wake it. Or you have paired with the group at the next table, which is why the name matters.
The long version, including Port View and how to read the port tiles, is in the Brick & Bluetooth guide.
Keep the cables behind the model. This one is a show for people to watch. A cable across the front is like showing them how the trick works.
Make one change at a time. Guess before each run. Judge every one from the watching seat, not from above.
Step 1 is the lesson. Nothing was spelled wrong. No block was wrong. Nothing broke. But the machine failed all the way. Two right moves happened in the wrong order.
When two parts must not move together, the order of the blocks is not a small detail. It is the machine.

Build the model before you read any further. Everything after this is about making it do something, and none of it will make much sense with nothing on the table in front of you.
One page at a time — use Next and Previous, or the ← → keys. Fullscreen makes it big enough to build from.
Check the finished build against the picture before you switch anything on. A motor mounted the wrong way round is far easier to spot now than it is to debug later, when it looks like a program fault.
Seven blocks. Two settings, then a loop of three moves that take turns. Use your own measured numbers instead of the 90s.
when program starts :: events hat [A v] set speed to (40) % :: motors [D v] set speed to (30) % :: motors repeat (3) [A v] run [clockwise v] for (90) [degrees v] :: motors [D v] run [clockwise v] for (90) [degrees v] :: motors [A v] run [counterclockwise v] for (90) [degrees v] :: motors end
Go through it in the order the Brick runs it.
What success looks like: from the watching seat, you see four different faces, one after another. You never see a card move. Can you see the turn? Then the trick has failed, even if every block ran just right.
Does the screen not cover the whole face? That is a build problem. No number will fix it. Go back to section 5. Use a bigger card, or a longer arm.
Work through them in order — each is harder than the last. The extra challenge comes after all three, and it is meant to make you plan before you build.
Show all four faces in one show. End on the face you started with. Every change must be hidden. Judge it from where the audience sits, not from above. If anyone watching sees a card turn, it does not count.
Add a reveal. Each time a face changes, play a sound or show a light. Do it just as the screen lifts, never before. Then time your show. A change every two seconds is quick. A change every five seconds is a slow reveal. Pick one on purpose and say why.
Make the screen hard to see moving, too. Right now it is a flap. People can watch it come down. Change the build or the speeds. Make the cover come down so fast that nobody has time to think about it. Then test it on someone who has not seen it before.
Put on a show for people who have not seen the model. Your machine must run a whole face-changing show for a group from another table. It needs a start, four changes and an end. Afterwards, ask them how they think it worked. If more than one of them guesses right, the trick needs more work. Plan on paper before you build. Write your show as a list of moments. Next to each moment, write which motor is moving and which is still. No line on your list may have both motors moving. When you show it, answer two questions. One block makes sure the screen is all the way down before the faces turn. Point at it. How does it make sure? And what would people see if you swapped just two blocks?