Challenge 1
Show all four faces in one performance, ending on the face you started with. Every change must be completely hidden — judged from the audience seat, not from above. If anybody watching can see a card turn, it does not count.
EV3 Robotics›Level 2 · Intermediate›Lesson 2
Level 2 · Lesson 2 · EV3-L02-0260 minutes · Ages 9–16 · 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 — and the audience sees a completely different face with no idea how.
It is a magic trick built out of two motors, and it only works if they take turns.
The last several models all needed their two motors moving in perfect step: the Frog, the Toddle Bot, the Push-up Robot, the cars. This one is the opposite. If both motors move at once here, the audience watches the face rotate and the trick is over.
Bian lian — face-changing — is a three-hundred-year-old Sichuan opera art. A performer sweeps a fan or a sleeve across their face and the painted mask changes colour instantly, again and again, faster than the eye can follow.

The secret is layered silk masks with threads the performer pulls. But the method is what matters to you today, and it is this: the change is always hidden behind something. A fan, a sleeve, a turn of the head. Never in the open.
The skill is not in changing the mask quickly. It is in making absolutely certain that the cover is in place before the change starts, and stays there until it has finished. Real performers guard the method so closely that in China it is officially a protected national secret.
Get the timing even slightly wrong and there is no trick. The audience simply watches you change a mask, which is not magic — it is somebody fiddling with their face.
And the failure is total rather than partial. A trick performed 90 % in secret is a trick that has been given away.
Cover first. Change second. Uncover third. Every order except that one is a spoiled trick.
Two motors doing two different jobs, and the order between them is the machine.
You already know how to make a program do one thing after another — blocks run down the page, top to bottom. What is new is that this is now the point rather than an accident. Lessons 24 to 29 fought hard to get two motors moving at the same instant. Here you want the opposite, and the plain stack of blocks gives it to you for free.
| 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) | Separate run blocks, one after the other. Each waits for the last to finish. |
And notice why the ordinary stack works here. A run for (90) degrees block waits until it has finished — the same property that made the Push-up Robot hang in Lesson 27. Here it is exactly what you want: the screen is guaranteed to be all the way down before the next block starts turning the faces.
Blocks in a stack take turns automatically. When two motors must not overlap, that is not a limitation — it is the tool.
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 — and 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 apparatus up. |
| Medium Motor, port A | Raises and lowers the white screen. Light and quick — a screen that drops slowly gives the game away. |
| Large Motor, port D | Turns the card holder a quarter turn at a time. Strong, because it is swinging four cards on an arm. |
This model does not work out of the box. The manual asks you to make the paper parts yourself, and without them there is nothing to reveal.
Sensors go in ports 1, 2, 3, 4. Motors go in ports A, B, C, D. They are not interchangeable, and nothing will tell you politely if you swap them.
There is a second rule underneath that one, and today is the lesson that shows why it exists. B and C are for a pair. Two motors doing one job together go there — the Frog’s legs, the Tricycle’s wheels, the Push-up Robot’s arms. Two motors doing separate jobs take A and D instead.
| Part | Port | Why this one |
|---|---|---|
| Medium Motor (the screen) | A | A single motor with a job of its own takes A — as it has in nearly every lesson up to 24. |
| Large Motor (the turntable) | D | The other job goes to D, deliberately skipping B and C so nobody is tempted to drive 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 performed to an audience, and a cable draped across the front is the visual equivalent of showing them how the trick works.
Seven blocks. Two settings, then a loop of three moves that take turns. Use your own measured numbers in place 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
Walk it in the order the Brick runs it:
What success looks like: from the audience seat, four different faces appear one after another, and at no point can you see a card moving. If you can see the turn, the trick has failed even if every block ran perfectly.
If the screen does not cover the face fully, that is a build problem and no number will fix it. Go back to section 5: a bigger card, or a longer arm.
One change at a time, and predict before each run — and judge every single one from the audience seat, not from above.
Step 1 is the lesson. Nothing was misspelled, nothing was the wrong block, nothing broke — and the machine failed completely, because two correct actions happened in the wrong order.
When two parts must not overlap, the order of the blocks is not a detail of the program. It is the machine.
Work through the challenges in order — each is harder than the last. The mission comes after all three, and it is meant to make you plan before you build.
Show all four faces in one performance, ending on the face you started with. Every change must be completely hidden — judged from the audience seat, not from above. If anybody watching can see a card turn, it does not count.
Add a reveal. Each face change must be announced by a sound or a light at the moment the screen lifts, never before it. Then time your performance: a change every two seconds is brisk, a change every five is a slow reveal. Choose one deliberately and say why.
Make the screen movement invisible too. At the moment it is a flap that a viewer can watch coming down. Change either the build or the speeds so the cover arrives so quickly that the audience is not given time to think about it — then check with somebody who has not seen it before.
Perform it to an audience who have not seen the model. Your machine must run a complete face-changing performance in front of a group from another table, with a beginning, four changes and an ending. Afterwards, ask them how they think it worked. If more than one of them guesses correctly, the trick needs more work. Plan on paper before you build. Write your performance as a list of moments and, beside each, which motor is moving and which is still. No two lines of that list may have both motors moving. Two questions when you demonstrate it. Point at the single block that guarantees the screen is fully down before the faces turn, and explain what makes it a guarantee. And what would an audience see if you swapped just two blocks?

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.
Use the viewer's own controls to zoom and turn pages. 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.