
Qu-Bot, A Quickly Programmable Robot User’s Manual
Page
49
of
52
8.5. Line Follower using one sensor
This code uses only one sensor to follow a dark color line on light colored floor.
•
In the start robot starts running left motor. Right motor is stopped. So the robot
takes a long right turn.
•
When it gets the line under the bottom sensor it continues to take right turn until
it crosses it completely.
•
After a small delay of 50ms the left motor stops and right motor starts moving so
robot takes a left turn.
•
Again it continues taking the left turn until it crosses the line. After a 50 ms delay
the procedure repeats because of infinite loop.