I'm not sure what value you have autocounter2 initialized as but according to your code the second while loop will never occur.
at the end of your fist loop assuming autocounter2 is initialized to 0 autocounter2 will equal 11 and since 11 is not equal to 2 it skips the second loop.
I'm also assuming from looking at your motor speed values that you are turning a little then driving full speed forward. if thats the case then here is my suggestion.
take out the if statement then when the first loop finishes and autocounter2 equals 11 the second loop will start and go till autocounter2 = 51
it would look like this:
Code:
while(autocounter2<=10)
{
pwm01=200;
pwm02=254;
autocounter2++;
}
while(autocounter<=50)
{
pwm01=254;
pwm02=254;
autocounter2++;
}
by the way use autocounter2++; instead of autocounter2=autocounter2++;