Quote:
Originally Posted by Ether
I can't give an example in LabVIEW because I don't have it installed here, but here's a skeletal pseudo-C code:
Code:
while (1) {
if (!run_me) {sleep(20ms); continue;}
run_me= false;
doSomething;
sleep(250ms);
doSomethingElse;
}
The global boolean "run_me" tells the task to run once.
Notice the "sleep(20ms)" which prevents the task from chewing up an undue amount of CPU time.
|
Ether, are you implying that if my global variable returns false, then it waits 20ms BEFORE doing whatever else is in that case statement? If so, wouldn't that cause the error since the Teleop code is taking >20ms to complete one cycle?