The tool’s interface below is still in French. The interface is being translated by Google Translate.
mBot: programming line following
Four sensor states, four decisions to make. Set your logic and watch the virtual robot follow the track.
Ma logique
Capteur : —
Programme
Comprendre les quatre valeurs
| Valeur | Capteur gauche | Capteur droit | Le robot est… |
|---|---|---|---|
| 0 | sur le noir | sur le noir | bien centré sur la ligne |
| 1 | sur le noir | sur le blanc | décalé à droite : la ligne est à sa gauche |
| 2 | sur le blanc | sur le noir | décalé à gauche : la ligne est à sa droite |
| 3 | sur le blanc | sur le blanc | sorti de la ligne |
Sur le vrai robot, le capteur se branche par défaut sur le port 2. La piste doit être une ligne noire mate d’environ 2 cm de large sur fond clair ; réduisez la puissance si le robot décroche dans les virages.
How to use the line follower simulator
Choose the robot’s action for each of the four sensor values, test your logic on a simulated track and get the program.
-
Set the logic
A few parameters are enough.
-
Run the simulation
The virtual robot runs your program.
-
Get the program
mBlock blocks and Arduino code.
About the line follower simulator
The line-follower sensor returns 0, 1, 2 or 3 depending on whether each of its two eyes sees black or white. Following a line comes down to deciding what to do in each case.
Three tracks of increasing difficulty let you check that the logic holds up in tight turns.
Frequently asked questions about the line follower simulator
What does the value 3 mean?
Both sensors see white: the robot has left the line.
Do I need a robot to use the tool?
No. It exists precisely to prepare or test a program before loading it onto the mBot.
Can it be used in class?
Yes, freely: in middle school technology class, in a robotics club or at home.