Base Mission
1 point Live judgedAll three Unstraight Cubes satisfy the definition (cubes are the black line).
Introductory · EV3 Coding Project 10
Your robot gets its first sense — and its first way of saying keep going until .
Student PIN:
Imagine the power is out and you are trying to cross a room you know well. Your eyes are useless. So you put a hand out in front of you and start walking.
Actually do it. Stand a few steps from a wall, close your eyes, put one hand out, and walk slowly toward it until you touch it.
You did not check once and hope. What were you doing the whole time you were walking?
That Is a Loop
Check. Step. Check. Step. Check — touched something — stop and do something different.
Repeating a check while you wait for something to become true is called looping, and it is the whole idea of this project.
Get your kit’s sensors out on the table — touch, color, gyro, and distance if your kit has one. Without looking anything up, sort them into two piles. You decide the rule.
| What went in it | |
|---|---|
| Pile 1 | |
| Pile 2 |
One Split Matters More Than the Others
Some sensor questions work like a light switch — yes or no, and nothing in between. Is the button pressed? Others answer with a whole range — how bright? how far?
If that is how you sorted them, you found the split programmers care about. Today is a light-switch day: the touch sensor, asked one yes-or-no question.
A turns something physical — a press, a color, a distance — into something your program can read.
The touch sensor’s yes-or-no question comes as a six-sided block — a hexagon. Hexagons do not do anything on their own. Each one is a question with exactly two possible answers: true or false.
Not pressed → the hexagon answers false. Pressed → it answers true. Nothing in between — a light switch, exactly like your sorting rule.
Every time you needed the robot to wait, you used wait 2 seconds. That will not work now. A sleeping program cannot notice anything. If you tell it to wait two seconds and the sensor is pressed after half a second, the robot never knows.
You need it to keep checking — over and over, as fast as it can. Hexagons snap into two Control blocks built for exactly that:
Wait until asks its question as fast as it can, thousands of times a second, and does not let the next block run until the answer is true. It is your hand-out-in-the-dark, as a block.
Repeat until is the same idea with a mouth: everything held inside its jaws runs over and over, as long as the answer is still false. The moment the answer turns true, the robot falls out of the jaws and moves on to whatever comes after.
Inside the Jaws, and After Them
What goes inside is the thing to keep doing. What goes after is what happens when the answer finally changes. Deciding which is which is the whole skill.
Put it together. Read it out loud: “start driving — keep checking until the sensor is pressed — then stop.”
⚠ The Stop Goes After, Not Inside
The wait until is the checking. The stop moving is what happens when the checking succeeds. Put the stop before the wait and the robot never moves; forget the start moving and the robot waits forever at a standstill, checking a sensor nothing will ever press.
Hexagons are not only about sensors. The green Operators shelf has three comparison hexagons, and they turn any pair of numbers into a true-or-false question:
| Hexagon | Asks | Example |
|---|---|---|
| < | is the left smaller? | 5 < 4 is false |
| = | are they equal? | 5 = 5 is true |
| > | is the left bigger? | 5 > 4 is true |
Today your question is is pressed? and you will not need these. But hold on to them — in Project 11 the loop stops watching a switch and starts watching a number, and these hexagons are how you ask about numbers.
One more: the green not hexagon flips an answer. not (1 is pressed?) is true exactly when the sensor is not pressed. You will want it the moment you need “keep going while nothing is touching.”
Mount your touch sensor on the front of the robot so it hits things before anything else does. Plug it into sensor port 1 — the numbered ports on the bottom edge are the sensor ports.
On the brick, open Port View and arrow over to port 1. Press the sensor with your finger and watch what it reports.
| Question | My answer |
|---|---|
| Which port is my touch sensor in? | |
| What does it show when nothing touches it? | |
| What does it show when I press it? |
⚠ Hold the Robot in the Air for the First Run
Do not put this on a table or the field yet. Hold the robot up so the wheels spin freely, run the program, then press the sensor with your finger and watch the wheels stop.
A loop that never sees its sensor never stops. Find that out in your hands, not off the edge of a table.
New project called Drive Until Bump. Plan it as first, then build the start-moving / wait-until / stop-moving stack from Learn It.
Wrap the hexagon in a green not: wait until not (1 is pressed?). Before you run it, write down what you think will happen.
Now run it. Then run it again while holding the sensor pressed the whole time.
What actually happened, both times? Explain why, using the words “true” and “false”.
Take the not back out.
Here is what makes a touch sensor genuinely useful: a wall is a place your robot can always find.
New project. Mount or turn the sensor so it faces backward — then drive backward until the sensor presses against the starting box wall, and drive forward a set distance into the box and stop.
| Code / part | What it means |
|---|---|
| 1. Start moving backward | A negative speed, or steering with a backward start — your choice. |
| 2. Wait until pressed | The wall ends the trip, wherever the robot wandered from. |
| 3. Stop and settle | |
| 4. Move forward a set distance | Into the box. |
Why This Matters More Than It Looks
No matter where the robot wandered off to, it can come back and touch a wall — and now it knows exactly where it is. Every measurement after that starts from a spot it can trust.
A robot that has been driving is still rocking when the checking ends. Momentum does not care about your program. Put a short wait 0.5 seconds between the stop and whatever comes next, and compare runs with and without it.
One more use for the same idea. Put a wait until (1 is pressed?) block at the very top of a mission program, before anything moves.
Now your robot waits for a tap on its sensor instead of driving off the second you press Run — which is exactly how you want to start a match.
That wait-until block has no jaws and nothing inside it. Is it still doing something the whole time? What?
Mission 13
All three Unstraight Cubes satisfy the definition (cubes are the black line).
Two Unstraight Cubes form a scoring stack — one Unstraight Cube is another.
All three Unstraight Cubes form a scoring stack. All cubes must originate from the Unstraight Cube area.
A Pyramid Counts --- and It Is Easier
Read the scoring examples again. A pyramid scores exactly the same as a three-high tower. Two cubes on the bottom, one on top.
This is a final-position mission, so whatever you build has to still be standing when the match ends. A pyramid is far harder to knock over than a tower. Take the easy 13 points.
Use the touch sensor to make your approach repeatable. If your robot can find a wall or a cube by contact instead of by timing, every placement after that starts from a known spot.
Where in your run does the touch sensor help most — finding the cubes, or finding your way back?
| Run | All three stacked? | Still standing at the end? | Points |
|---|---|---|---|
| 1 | |||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 |
Did the stack fall over on any run? What knocked it — the robot leaving, or the stack itself?
| Mission part | Scored? | Points |
|---|---|---|
| Mission 13 — Advanced Bonus (all three cubes stacked) | 13 | |
| My total | 13 |
With Project 6 and Project 8, Mission 13 is now worth 21 points across all three parts — the most any single mission has given you.
Say which blocks you would use for each.
| I want the robot to… | My blocks |
|---|---|
| Drive until the sensor is pressed | |
| Drive while the sensor is pressed, stop when released | |
| Do nothing until someone taps the sensor |
Each of these is wrong. Say what happens when you run it.
| The stack | What goes wrong |
|---|---|
| start moving · wait 2 seconds · stop moving — used to “wait for the bump” | |
| wait until pressed · start moving · stop moving | |
| stop moving inside the jaws of a repeat-until that is supposed to be driving | |
| wait until pressed, with no start moving anywhere |
Since Project 3, every distance your robot has driven was really a length of time. What does a touch sensor give you that a stopwatch never could?
A touch sensor only tells you something when you are already touching it. Name one thing on the field you would want to stop at, where bumping into it first would be a bad idea.
Your loop asks a question over and over. So far the question has always been about a sensor. What else could a robot count or measure that a loop could watch?
A wall tells you where you are, but only if there is a wall. Most of the field has nothing to bump into.
In Project 11 — Counting and Turning by Feel, you point the same checking at a number instead of a switch — the degrees your wheels have rolled, and the angle the whole robot has turned. The brick has been measuring both all along.
Download saves a local copy of your answers. It does not turn in your work automatically; give the downloaded file to your teacher.
KIPR · Botball Explorer — Introductory Projects · © KISS Institute for Practical Robotics 1997–2026