How to use the if/then block in LEGO SPIKE Prime Word Blocks software Pro Preview

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

Subscribe

  • #2291
  • 29 Jul 2024

The if/then block is the fourth block in the orange Control section.

content picture

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.

content picture

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

Image for  Level B1 - Carnival - Robotics with LEGO SPIKE Prime
  • 23
  • 1:03
  • 62
Image for Lesson 4 - Bumper car
  • 3
  • 5
  • 8
  • 3d_rotation 1