Quote:
|
Originally Posted by Daisy
After running it in my head (which may not be accurate), I think time is the problem. You're incrementing time, so that after 49, it reaches 50, but at it, you do not define what it does with it (ie Left() or Stop(), etc), so it will keep repeating left.Daisy
|
Yeah, but time gets incremented outside of the if statements. Unless he is clearing the PWM values somewhere, whatever was set in Left will still be sent to the motors for an additional cycle. If he is clearing the values, there would be a 1 cycle pause in the PWM output.
I agree with what was said above. Most likely the time variable isn't global or statically defined. Debug prints should make this apparent rather quickly if this is the case.