Now that you know how the distance sensor works, how do we use it?

To access the full video please subscribe to FLLCasts.com
- #2219
- 24 Jul 2024
The distance sensor event block is the fourth in the Events section.
The block has four settings:
- The first setting specifies the port where the sensor is connected to the hub.
- The second setting determines when you want the block to activate. It can trigger if something is closer than, further than, or exactly at a certain distance.
- The third setting is the specific distance you want to measure.
- The fourth setting is the unit of measurement for the distance. You can set it to percentages, centimeters, or inches.
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons

Level A2 - History and Mythology - Robotics with LEGO SPIKE Prime
This is the second level of the LEGO Robotics Curriculum for second, third, and fourth-grade students.
In this level, we will focus on History and Mythology, with each lesson covering a different aspect of the ancient world. You will learn about a new distance sensor that uses ultrasound to help a watchtower robot detect invaders. We will also introduce new concepts such as loops, degrees, and a third motor. Additionally, you will learn how robots can perform two different tasks simultaneously.
- 28
- 0:00
- 65

Lesson 5 - Watchtower
Introduction
Do you know what a lighthouse is? What do you think it is used for?
A lighthouse is a building that has a light to help sailors navigate at night or in bad weather. Lighthouses have been in use for as long as people have sailed. Today, we will learn about the oldest existing lighthouse still in use: the Tower of Hercules. Built in the 1st century AD during the Roman Empire, it is located in the northwestern part of Spain and is still operational. It was constructed by the Roman architect Gaius Sevius Lupus in honor of Mars, the Roman god of war. It functioned as a lighthouse until 1788 when it was rebuilt, as it was almost a ruin at that point. Since then, it has continued to help sailors navigate the eastern Atlantic Ocean!
Besides navigation, lighthouses also served as watchtowers. People needed to know when ships came and went and whether the ships were friendly or not. Today's robot will be just like a lighthouse with someone watching from the top. We'll achieve this with a new sensor!
- 3
- 4
- 8
- 3d_rotation 1