Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Robots follow instructions by running a program, which is a list of steps written by a human. In block coding, each colorful block stands for a command, a question, or a repeated action. A robot reads these blocks in order, usually from top to bottom, and turns them into movement, sounds, lights, or decisions.

This matters because clear instructions help robots do useful jobs safely and correctly.

Key Facts

  • A program is a set of instructions that tells a robot what to do.
  • Sequence means instructions run in order, usually from top to bottom.
  • Command example: drive forward 20 cm tells the robot both the action and the distance.
  • Condition example: if sensor sees wall, then stop makes the robot choose an action based on information.
  • Loop example: repeat 4 times can help a robot make a square by repeating forward and turn commands.
  • Sensor input is data from the robot's surroundings, such as light level, distance, touch, or sound.

Vocabulary

Program
A program is a set of instructions that a robot follows to complete a task.
Command
A command is a single instruction that tells a robot to do something specific.
Sensor
A sensor is a device that helps a robot detect information from its surroundings.
Condition
A condition is a rule that makes a robot do one action if something is true and another action if it is not.
Loop
A loop is a part of a program that repeats the same instructions a set number of times or until a condition is met.

Common Mistakes to Avoid

  • Putting blocks in the wrong order: robots follow the sequence exactly, so a turn before a forward command can send the robot in the wrong direction.
  • Forgetting to include a stop command: a robot may keep moving if the program never tells it when to stop or what condition should stop it.
  • Using a loop without checking what is inside it: every block inside the loop repeats, so one extra turn or drive command can change the whole path.
  • Ignoring sensor values: sensors give numbers or true-false information, so the program must use the correct threshold or condition to respond correctly.

Practice Questions

  1. 1 A robot has this program: repeat 4 times: drive forward 30 cm, turn right 90 degrees. What shape does it trace, and what total distance does it drive?
  2. 2 A robot moves forward at 10 cm per second. A command says drive forward for 6 seconds, then stop. How far does the robot travel?
  3. 3 A robot has a light sensor rule: if the light reading is less than 40, turn on headlights; otherwise keep headlights off. Explain what the robot should do in a dark room and why.