Have you ever wondered if your robot can make decisions? Here's how we can make that happen!

To access the full video please subscribe to FLLCasts.com
- #2292
- 29 Jul 2024
The if/else block is the fifth block in the orange Control section.
It is used in combination with a Logic block, that you can put inside the if/else block. The Logic block determines if the blocks in the if/then section of the block will be run or the blocks in the else section will be run!
Logic blocks can primarily be found in the Sensors and Operators sections.
Logic blocks can either be True or False. If the block is True, the first set of blocks will run; if it's False, the second set of blocks will run. For example, if we use the force sensor logic block as shown in the picture above, it will be False if the sensor isn't pressed and True if the sensor is pressed. So, if the force sensor is pressed, then the blocks inside the if/then section will run; else, the blocks in the else section will run!
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons

Level B1 - Carnival - Robotics with LEGO SPIKE Prime
This is the third level of the LEGO Robotics Curriculum for students in second, third, or fourth grades.
Carnival and Amusement Park Level. Each lesson has a theme related to carnivals and amusement parks. Students learn about physics concepts of inertia, center of mass, and centrifugal force. New ways of programming the force and distance sensors are introduced. We work with new concepts: forever loop, if/then, and if/else.
- 23
- 1:03
- 62

Lesson 5 - Ferris Wheel
Remember to provide feedback to students regularly. It's important to give structured feedback in the form of a grade. Today, you'll need to grade your students following this article.
- 4
- 5
- 9
- 3d_rotation 1

Level B2 - Introduction to Robotics Competitions - Robotics with LEGO SPIKE Prime
This is the fourth level of the LEGO Robotics Curriculum for students in second, third, or fourth grades.
Competitive Introduction Level: Each lesson has a theme related to various LEGO robotics competitions. Students learn about FIRST LEGO League, Line Following, and Sumo Wrestling. A new color sensor is introduced, and students use forever loops, wait until commands, and if/else statements in new ways.
- 21
- 1:03
- 60

Lesson 6 - Line Following Part 2
In the next lesson we usually do a graduation. Write down your impressions about the students and the reasons why they have the grades you gave them.
- 4
- 6
- 7
- 3d_rotation 2