View Single Post
  #9   Spotlight this post!  
Unread 11-03-2004, 14:50
Xufer's Avatar
Xufer Xufer is offline
8 Seasons and as stable as ever
AKA: Working, 2/4 degrees complete still schooling...
FRC #1740 (The Cyber Colonels)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Waterford, CT
Posts: 231
Xufer is a splendid one to beholdXufer is a splendid one to beholdXufer is a splendid one to beholdXufer is a splendid one to beholdXufer is a splendid one to beholdXufer is a splendid one to behold
Send a message via AIM to Xufer Send a message via MSN to Xufer Send a message via Yahoo to Xufer
Re: quick question: TIMERS

Quote:
Originally Posted by 10intheCrunch
That's all up in my post...

Make a "StateInit" function that runs everytime you move to a new state, that at the very least resets your count to 0. Put a count++; statement after the switch. Then, inside each case, say

if(count > someNumber){
StateInit();
state++;
}

That will move it to the next case when the count is above the number you want. Since you don't have a real timer you'll have to do the math yourself for how long to stay in each one but it shouldn't be that bad.
If you do that wont the count everflow after it reaches 254 ? whats to keep it from doing that ? Im still kind of missing it i guess. Or how would i make a real timer i mean i treid experimenting with one but i failed.
__________________


If saftey is first and i put FIRST ahead of everything, then i must be the safest guy in the world.

Team 521 Alumni -- Team 1740 Mentor-- Go Go 1740!
Sometimes I think I've been doing this too long and other times I think I haven't done this enough... but all the times I'm sure I'm crazy
Photonics, It's Your Future