View Single Post
  #3   Spotlight this post!  
Unread 11-02-2004, 07:34
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: how to add sevral steps to an encoder autonomous program

Quote:
Originally Posted by Zaramel2002
I was wondering how to make the program below count the encoder then go to another step instead of ending.

Im trying to make this code my encoder program for this years robot please help.
I use a static and a loop (in this case, Count is incremented by the sub, but is easily modifiable for ticks)

Code:
void Auto(void)
{
 static long Count = 0;
 if (Count >= 100) //Example, highest first
 {
  //Step 5
  count=0
 }
 else if (Count >= 80) //Example
 {
  //Step 4
 }
 else if (Count >= 60) //Example
 {
  //Step 3
 }
 else if (Count >= 40) //Example
 {
  //Step 2
 }
 else if (Count >= 20) //Example
 {
  //Step 1
 }
 Count = Count + 1;
} //End Auto()