Introductory · SPIKE Coding Project 2
Your First Program
Find out what every block in that program actually does — then change it and make it yours.
Student PIN:
Try It — Guess Before You Know
In Project 1 you ran a program that somebody else planned. Here it is again.
Do not look anything up. Do not ask anyone. Just guess — you will find out in a few minutes whether you were right.
The purple block is the only one that made something happen on the light grid. What do you think the yellow one is for?
The yellow block has a curved top, and nothing can snap in above it. Every other block is flat on top. Why might that be?
The two blocks are snapped together, not floating apart. What do you think the snapping means?
Keep Your Guesses
Do not erase them, even if they turn out to be wrong. Being wrong and then finding out why is how this works.
Learn It — The Program, Piece by Piece
Every word-block program you write has the same shape: one special block on top, and instructions snapped underneath it.
| Code / part | What it means |
|---|---|
| when program starts | The . When you press Run, the robot always starts here — at the hat — and works its way down. Nothing can snap above it. Every program needs one. |
| write “Hi!” | An instruction — one action for the robot to carry out. This one scrolls text across the light grid. The white oval is the part you can change. |
Snapping is the grammar
Blocks snapped into a column make a . The robot runs a stack from the top down, one block at a time. A block that is not snapped into the stack is not part of the program — it just sits on the canvas, ignored.
And here is something quietly wonderful: blocks that do not belong together will not snap together. The shapes only fit the ways that make sense. In block coding, you cannot misspell a command or forget a piece of punctuation — the snapping is the grammar, and it checks itself.
The shelf is a library
Every block on the colored shelf is a ready-made command — for driving motors, lighting up the grid, playing sounds, and reading s. You do not have to build them. The colors are the filing system:
| Color | Category |
|---|---|
| Yellow | Events — hat blocks. Where programs start. |
| Purple | Light — the 5×5 grid: write text, show pictures. |
| Orange | Control — waiting, repeating, deciding. |
| Pink | Motors and Movement — you will meet these in Projects 3 and 4. |
| Magenta | Sound — beeps and effects. |
| Light blue | Sensors — coming in Project 10. |
Order matters, and speed is not the point
The hub reads your stack like you read a book: top block first, then down, one at a time.
It is fast — it moves from one block to the next far quicker than you can blink. Watch what that does to this program, which shows a happy face and then a heart:
Run this and you will only ever see the heart. The happy face was there — for a sliver of a second, before the next block replaced it, faster than your eye can catch.
Turning Something On Is Not "For a While"
A turn on block means “show this, starting now, until something replaces it.” It does not mean “show this for a while.” If you want a while, you have to ask for it — and that is the wait block’s whole job.
The wait block counts in seconds
The number in a wait block is seconds — and it does not have to be a whole number. Half a second is 0.5. Fill this in before you build anything:
| You want to wait… | Write |
|---|---|
| 2 seconds | |
| 3 seconds | |
| Half a second | |
| A second and a half |
Plan before you build
Before you drag a single block, write your plan in plain language. That plan is called , and good programmers never skip it:
| Code / part | What it means |
|---|---|
| 1. Show the happy face | |
| 2. Hold it for 2 seconds | |
| 3. Show the heart |
And your work is yours: your names go in the project name. That is your . If you borrow a teammate’s idea, say so out loud and give them credit — that holds even when you change their idea a little to fit your program.
Where else in school are you expected to give credit for someone else’s work?
Back to your guesses
Look at what you wrote in Try It. Which guess were you closest on, and which one were you furthest off?
Do It — Make It Yours
Connect to your hub the same way you did in Project 1 — check your Robot Card. Open your First Project.
Step 1 — Say hello yourself
Tap the white oval in the write block and change Hi! to your own name. Run it.
You changed the oval, not the block. What is the difference between the block and the oval inside it?
Step 2 — Build the two-picture program
Make a new project called Pictures — names in the project name. Build the happy-face-then-heart program without the wait block first, exactly as it appeared in Learn It. Run it.
What did you see on the light grid, and what did you not see?
Step 3 — Slow it down
Now snap a wait 2 seconds block between the two pictures. Run it again.
The wait block does not show anything on the grid. What is it actually doing while the happy face is up?
Step 4 — Make it three of your own
Add a third picture of your choice to the end, with a wait before it, so the program shows three pictures with time to see each one. Plan it as pseudocode on paper first: three show lines, two hold lines.
Step 5 — Break it on purpose
Now the important part. You are going to make five mistakes deliberately, one at a time, so that when you make them by accident you already know what they look like.
For each one: break it → run → write down what happened → fix it → run again.
| Break this | What happened when you ran it |
|---|---|
| Drag a picture block off the stack so it floats alone on the canvas | |
| Move the wait block above the first picture | |
Change wait 2 to wait 0.2 | |
| Add a second hat block with a sound block under it | |
| Turn the hub off, then press Run in the app |
⚠ When a Program "Does Nothing"
Blocks cannot be misspelled — the snapping is the grammar. So your bugs will not look like errors. They will look like a robot quietly doing the wrong thing. When that happens, check three things, in this order:
- Is the hub actually connected?
- Is every block snapped into a stack under a hat?
- Is anything happening too fast to see?
Change one thing, then run again. Do not fix four things at once.
Two Signs Worth Recognizing
A block with a warning mark is asking for something that is not there — later, that will usually mean a motor or sensor missing from the port the block names.
The app asking you to connect when you press Run means your program has nowhere to go. The robot is not broken. It just is not listening.
Which of the five bugs would have been hardest to find if you had made it by accident? Why that one?
Score It — Checkpoint
No field mission yet — that starts in Project 4. This checkpoint is about whether you can read a program and predict it.
Read the program
A team builds this: hat block, heart picture, wait 0.5, happy face, wait 0.5, heart again. Describe exactly what the light grid will do, from Run to finish.
Can you do it again?
Think about it
Professional programmers spend most of their working time . Does that surprise you? What does it tell you about what a bug actually means?
Next
You can now make the robot say things and wait. In Project 3 — Motors and Ports, it stops talking and starts moving.
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