View Single Post
  #2   Spotlight this post!  
Unread 09-03-2007, 05:17
BorisTheBlade's Avatar
BorisTheBlade BorisTheBlade is offline
lead programmer 2004
AKA: Dane
FRC #1351 (TKO)
Team Role: Mentor
 
Join Date: Oct 2005
Rookie Year: 2004
Location: San Jose, Ca
Posts: 23
BorisTheBlade has a spectacular aura aboutBorisTheBlade has a spectacular aura aboutBorisTheBlade has a spectacular aura about
Send a message via AIM to BorisTheBlade
Re: autonomous timing

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++;
__________________
Team 1351 TKO Robotics (click for our website)
2007 sacramento regional Johnson & Johnson Sportsmanship Award winners
2007 CAL Games Finalists

Last edited by BorisTheBlade : 09-03-2007 at 05:21.