Million Whys Press logo
Million Whys PressToronto
← Book 15 videos

Book 15, Question 126 · Video

How Does a Robot Decide What to Do Next?

Video · 1:50 · Crafty Clover explains, from A Million Whys Book 15

A robot decides what to do next by following rules that connect what its sensors say to what it should do! The computer checks the rules one at a time. Then it picks an action, and

Read the full answer →

What Crafty Clover says in this video

Intro

Hi there, curious minds! I'm Crafty Clover! Let's discover something amazing. How does a robot decide what to do next?

The Big Idea

A robot decides what to do next by following rules that connect what its sensors say to what it should do! The computer checks the rules one at a time. Then it picks an action, and does it all again.

Read the Sensors

Step one: read the sensors. A robot's sensors tell its computer what is happening, like whether something is touching its bumper. That information is the input.

Check the Rules

Step two: check the rules. The computer checks the rules one at a time, usually from most important to least. For example: if the bump sensor is pressed, back up. If not, keep going forward.

Act and Repeat

Step three: act and repeat. The robot does the action, then goes back to the start. It repeats this loop over and over, many times each second.

A Closer Look

Let's take a closer look! First, the robot asks a question. If the answer is yes, it backs up. If the answer is no, it drives forward. Then it starts over and asks again.

Quick Facts

Quick facts! Important rules, like safety ones, are checked first. A flowchart is a drawing of the rules, with boxes and arrows. Programmers use flowcharts to plan before they write code. Test your flowchart by following it yourself, step by step.

Think Like a Scientist

Now, think like a scientist! Draw a flowchart for a robot crossing a room. Use a box for Is something in the way, and a box for Drive forward. Add arrows for yes and no. Then test it by following your own chart!

Outro

A robot follows rules that link its sensors to its actions. Science is amazing! Crafty Clover can be found on Amazon Books, Google Bookstore, and Apple Books. Available for purchase or download! Bye for now!

Why I wrote this