while loops and timers issue
I am teaching a class on RobotC basics and Vex and am new to robotc. Students and I are trying to write code for a simple program that has use a timer for 10 to 20 seconds to control the robot. While under the timer loop (while statement) the robot needs to go forward until it senses an object turn left or right then go forward turn left or right then go straight. After 10 seconds gives the user control of the robot through joystick controller. So far we can either get it to sense the object or go straight for 10 seconds then give up control but not both. Example code below. Thoughts?