View Single Post
  #4   Spotlight this post!  
Unread 11-02-2004, 08:35
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: how to add sevral steps to an encoder autonomous program

Quote:
Originally Posted by Astronouth7303
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()
Nice example.
__________________