Project 10: Soccer with Bounds
Share
Project 10: Soccer with bounds (don't go out of bounds. find the ball. Go straight if facing north, otherwise go around)
A way to check the line sensor while waiting is to use a timer with a while loop. Instead of an infinite loop, we can do the while loop while the timer is below some time, and inside the loop check the line sensor to see if we detect a line.
For example, this program goes forward for 1 second but goes backwards if it sees a line while it is going forward.
Solution: