Quote:
Originally Posted by gnirts
You might want to investigate using WPILib. You can use a function like sleep() (except it's called wait()) there because it handles things differently. See the bottom of page 50 of the manual (pdf). More information is available in the WPILib section of this forum.
For someone coming from a InteractiveC background it might be much more familiar.
|
That looks like a good suggestion.
I suppose the other thing that could be suggested here is that if a true stall of all code execution is really what is desired, and precison wasn't a primary concern, that a simple FOR/NEXT loop could be setup to approximate the correct delay.
Code:
#define LOOPTIME 50 // emperically choose a number that provides the desired timer resultion
void Sleep(unsigned int timer) {
unsigned int i;
while(timer--) {
for (i=0;i<LOOPTIME;i++);
}
}