|
Re: Controlling Motors in Auto
The principle idea is the same. You will generally make a sequence of value updates, wait for time, wait for a sensor, perhaps some logic paths based on a sensor input or an auto parameter, and you will tweak it a number of times to tune the values.
I believe the top code shows how to make a literal sequence of blocks that move the robot. It would be pretty easy to update this to move forward to another zone.
The other code, with the loop, is more general in that it executes based on a recipe. The array of movements is perhaps easier to read or generate, and can be enhanced to include other robot actuator elements too.
Auto will automatically stop after 15 seconds, ending any infinite loops or anything else you happen to put into auto. So I'd say the primary things to avoid are side-effects such as closing I/O refnums or setting globals or motors to wonky values that you don't correct during disable or at the beginning of teleOp.
Greg McKaskle
|