|
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
|