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

To access the full video please subscribe to FLLCasts.com
- #2291
- 29 Jul 2024
The if/then block is the fourth block in the orange Control section.
It is used in combination with a Logic block, which you can place inside the if/then block. The Logic block determines whether the blocks within the if/then block will run or not.
Logic blocks can primarily be found in the Sensors and Operators sections.
Logic blocks can either be True or False, and the if/then block runs the blocks inside it if the condition is True. 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 block 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 4 - Bumper car
Introduction
Have you ever been in a bumper car? Have you driven such a car?
In this lesson, we will build a bumper car and program it to sense when it has been bumped! The first patent for a bumper car ride was published in 1921, and since then, bumper cars have been a staple attraction all over the world. Even some cruise ships have bumper car rides!
- 3
- 5
- 8
- 3d_rotation 1