View Single Post
  #6   Spotlight this post!  
Unread 11-03-2004, 06:06
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: quick question: TIMERS

Quote:
Originally Posted by Xufer
huh ? dun quite get it, too tired maybe ...
Instead of stead of what you currently have, you'd put in something like his example. The basic idea is laid out below: (in semi-pseudo-code)
Code:
Static state variable starting at 0

switch(state variable)
{
    case 0:
        perform actions set 1
        check if this state is complete
             if it is, increment the state variable

     case 1:
        perform actions set 2
        check if this state is complete
             if it is, increment the state variable

    case 2:
        perform actions set 3
        check if this state is complete
             if it is, increment the state variable

    ...

     case X:
        don't do anything
}
By repeatedly calling this switch statement, it will work its way through all the states. You can, of course, also have statements in there that reset the statee variable, or put it to where ever you want.

Hope that clarifies it some.
__________________