In this video tutorial we follow a line 10 consecutive times. In this way we demonstrate whats the consistency that you could expect from the robot when following a line with a multi-states algorithm.
- #1936
- 30 Jun 2022
- 3:12
- LEGO Education SPIKE Prime
- Line follow, 10 out of 10, Line following, LEGO Education SPIKE App Word Blocks 2, Scratch, Programming, Sensors, Light and Color Sensor
How to use this tutorial?
Download the program and check how your robot behaves. Is it more or less consistent. This will help you set the expectations of what you can expect from the robot and will generally be much more fun.
English
In this video tutorial we will do a ten out of ten runs on how to follow a line with a multi-state program. We use LEGO Education SPIKE Prime. Let's see how it works. Ten runs. How consistent is the robot? We follow the line, we take the turn and this is where we stop. These are 10 seconds for our robot. Let's try again. We'll do ten of those "follow the line".
So it's almost at the same place.
10 seconds. A lot of turns. There could be a lot of slips and wheels - they could slip on the map. But at the end we arrived at almost the same place. Here we are at exactly a different place. The point here, and what I'm trying to emphasize on is that if we just rely on the timer to follow the line, it might not be the best idea because when we rely on time, the robot could arrive at different places. We should always rely on something else, like another event that could happen. For example, we detect a different line with the other sensor and in this way we say we are at the exact location. It's not that we've waited some time and we hope we are there. We specifically wait for events to occur. Let's do a couple of more of those. Start, follow third right here on the left turn. We kind of get to the same place, but just relying on the timer. And in some of the next tutorials we'll demonstrate how you can wait for another event to occur. How you can, for example, stop when you detect the second black line. And this way you know exactly where you are on the field, which is priceless, because that's what's difficult on the competition. It's difficult to know with your robot where you are on the field. If you can figure this out, the rest is quite easy. So how can we know where we are on the field? Again, turn,
download, experiment and see you in the next tutorial.
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons

LEGO Education SPIKE Prime Programming for Competitions with Word Blocks
Two fundamental concepts are essential for robotics competitions: ensuring the robot consistently navigates and positions itself accurately on the field and designing attachments that complete missions once the robot reaches its target. This course focuses on the first aspect - precise navigation and positioning - while the second is covered across the entire FLLCasts platform, starting with the FIRST LEGO League with LEGO Education SPIKE Prime. "Challenge" competition for 9-16 years old
The goal of this course is to help you learn how to program LEGO Education SPIKE Prime robots to operate consistently and reliably in competition settings. We use LEGO Education SPIKE App Word Blocks, a Scratch-based programming language, to teach key techniques applicable to FIRST LEGO League and World Robot Olympiad competitions. Topics covered include different methods for line following, such as fast, slow, smooth, and using multiple states, as well as techniques for line alignment, double alignment, and maintaining a straight path using the motion sensor.
- 40
- 188:21
- 19
Color Sensor - Follow a line with a multiple states algorithm
On the topic of following lines with a robot there is a way to make the robot follow the line a little more precisely. This method is called "Multi-states" program. Or at least we call it like this. In this tutorial you will see how we program 5 state for the robot line following program. This could be particularly important with FIRST LEGO League competitions where we must build consistent and reliable robots.
- 2
- 0
- 1
- 3d_rotation 1