Quote:
Originally Posted by jerry w
be careful with while loops. such as;
Code:
while(!getTopLimit())
Remember that the top level loop is controlling robot communication with the field. When you add lower level loops, everything waits for those loops to finish.
It is best to use "IF" statements and avoid loops.
|
Not always true any more. With the old IFI system it was but now we have a real time operating system. If you spawn off your limit checking code into a new process this while(!getTopLimit()) will function as expected. However, you would need to create a new process for the bottom limit as well. Because of the cost associated with context switches it may not be the best approach.