Studyfin Studyfin ✨ Sign up free

Robotics & physical computing

Grade 7 · Coding · Free lesson

Hi! I am Studyfin, your tutor. Let's learn how to write code that makes real-world robots move and react!

Physical computing means using code to control real objects, like lights, motors, and robots. We write programs on a computer and send them to a physical device.

To solve a problem, we use a design process. First, we plan our steps. Then, we write code using sequences, loops, and conditionals to guide the robot.

1. PLAN 2. CODE GO!

We also use events. An event is an action that triggers code, like pressing a button on the robot to make it start.

Press Button Robot Light
✏️ Worked example

Design a program to make a robot car drive forward until it senses a wall, then stop.

  1. 1. Identify the goal: The robot must move forward and stop before hitting a wall.
  2. 2. Plan the event: The program starts when we press the robot's 'Start' button.
  3. 3. Create a loop: Make the robot drive forward repeatedly.
  4. 4. Add a conditional: Inside the loop, check if the distance sensor detects a wall closer than 10 centimeters.
  5. 5. Stop the motor: If the conditional is true, break the loop and turn off the motors.
Want the full interactive lesson — quiz, animations, and Finn cheering them on?

More Coding lessons