I want to create a program that allows the robot mbot2 to follow a path and stop on a color depending on a button on the cyberpi.
If I program a stop separately, the robot correctly follows a black line then will stop on the red color (L1 R1 sensors are used). Ditto for a stop on a green color. It ends its journey by returning to a white color.
On the other hand, I have a problem concerning the management of 2 stops in the same program. In my program, I replace black line by line to avoid confusion when I want it to stop on red but go ahead on green. The robot does not pick up the color.
Thank you very much
autonomous vehicle.zip (56.6 KB)