Instructional Material: EV3 - Under Construction SwitchLoops

Printer-friendly version

In this lesson students will continue to explore the technique of embedding a Switch block inside of a controlled loop in order to accomplish continuous obstacle detection. This lesson should help students to master some of the problems they probably encountered in 'Switches'.

In the previous unit, under "Switches", the students created a program for a Sensor Controlled Loop that was intended to stop for obstacles and then continue when the obstacle was removed.. However, what the program actually did was only check for the obstacle periodically and not continuously. The students should have discovered this was due to the fact that while the loop was controlled by a ultrasonic sensor, inside the loop were blocks that took some time to complete, so the robot only looked for obstacles once every few seconds. The solution to this problem is to reverse roles and have the ultrasonic sensor quickly and continuously check for obstacles and lack of obstacles inside the same loop that controls how far the robot moves. The introduction of the Switchloops block in this unit enables this capability.


In this section we have the following resource:

The EV3 Trainer lesson on Switches

Resource 1:

The EV3 Trainer has a lesson describing Switches working with Loops

Behaviors  > Decisions > 9. Switchloops

The EV3 Trainer Teacher's Guide references this on pages 77-82.

The EV3 Trainer Teacher’s Guide has additional reproducibles for those who have purchased the product.

The reproducibles for Switch Loops can be found on pages 109-112.

Material Type: 
Education Level: 
HW Platform: 
SW Platform: 
Interactivity Style: