Program does not end
I have a problem with my autonomous code. It involves the use of a lot of while() loops that the compiler says will not end. I heard you might have to put an extra condition in the loop such as "If the motor is not on..."(In code). Here's my code:
while (rightteeth < 4 || leftteeth < 4)/*if robot has not turned four gear tooth counts... */
{
pwm13 = 0; /*rev left motor */
pwm15 = 255; /*forward right motor, hopefully will turn robot about ten deg's */
}
The variables rightteeth and leftteeth are to count inputs from the hall effect sensors.
Please someone help me!
|