When we use one switch block, we allow the program to make a decision in accordance with the condition we have set. But what should we do if several conditions have to be met?

To access the full video please subscribe to FLLCasts.com
- #1177
- 29 Mar 2019
One option is to put a switch block in another switch block:
This example shows the combinations between two touch sensors. As a result, the robot will execute the programmed operations: 1 - when both buttons are pressed, 2 - when only the first button is pressed, 3 – when only the second button is pressed and 4 – when both buttons are released. Following the same logic, if we have more conditions, we may include more switch blocks.
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons

Robotics with LEGO - Level 3.0 - Security systems
This is the fifth level of the Robotics with LEGO curriculum for students in fifth to twelfth grades.
In this level students will learn how to work with data measured by the sensors. The concept of Algorithm is introduced and the programs perform calculations without knowing the values beforehand. The programming blocks transfer data between each other via data wires. The robots are designed to address the problems of security systems. Variety of alarm systems are built and the physical principles of different security methods are considered.
- 50
- 1:03
- 213

Lesson 7 - Card reader
Introduction
This morning the cake robbers escaped from prison. In order to evade the security system we created, they joined forces with bank robbers who have just been caught thanks to a secret vault door alarm installed in the last bank they attempted to rob. Now, the two gangs are trying to rob all of the bank’s ATMs. It’s time to stop them!
- 6
- 7
- 8
- 3d_rotation 1