39FA4CF2-B2F0-4EA0-B9D6-AF91813AC159.heic

Island 6 LEGO EV3 Level 3 Decisions, Loops and Switches

Robotics & Control Technology

POP students are challenged to build and program a robot with loops and switches to influence their actions and decision-making process.

831B9DF5-A5AE-4319-BB92-6C28A19CE1E8.heic

Island 6 LEGO EV3 Level 3 Decisions, Loops and Switches

Design Specifications

What are Loops and Switches?

Computer programmers use a loop to create a repeated situation or behavior. Imagine that a robot is cutting with scissors. The cutting movement needs to continue for a certain distance or time. The programmer instructs the robot to repeat the up and down movement until a designated end point. 

A switch is used for a “yes-no” or an “if-then” decision. Remember that in programming, there are always only binary decisions (two options). This type of question creates a clear, concrete process

 

How to Use the Binary Question Process

When programming your robot, you will be outlining the binary questions that your robot will be “asking” and responding to.

Imagine yellow, green, red, and blue lines on the floor. You want the robot to turn right at the red line. As the robot travels across the lines, it must identify the color and make a decision: Red or not red, turn right or do not turn.

The program is written to ask the question, “Is the line red?” If the answer is “no,” then the program instructs the robot to go straight until it gets to another line. At the next line then the program asks the same question. The robot continues forward until the answer to the question is “yes.” Then the program makes the robot turn right.

Programmers write algorithms, or steps to carry out specific tasks or solve specific problems. These algorithms are used to control the robot's decision making based on information from one or more sensors. All of the algorithms for a robot are included in the robots programming code.