Quote:
|
But if I did use the variable, wouldn't it ensure that the subroutine just runs 1 time and never again until the robot is powered on? If I wanted a subroutine to run just one time in default_routines, would this need be used?
|
I don't completely understand your question?
It has to execute more than one cycle because a cycle only runs for a fraction of a second.
Now if you just want to run it once and set a bunch of pwm values then it will work but if you want to adjust these values later then it can't because it is not executing.
Quote:
|
Like here won't it continuously loop the Auto code(An any subroutines in it) until it realizes 'hey, I am not in auto mode anymore'?
|
First, yes it will and it is controlled by that switch mechanism you make for the operator interface.
In the real competion that loop autonomous_mode will execute for however long they singnal it to run in autonomous (10 sec for this years game).
If you make that switch mechanism you can run this loop for as long as you want. While the switch is on.
What I gave you before just lets you test auton without haveing to make that switch box. It lets you control how long the auton runs because you don't know when the robot starts acting crazy.
But FOR THE COMPETETION if you want he auton to work you have to put it in this user_routines_fast.c
Second the pwms 13-16 are different as they are generated by the user processor while all the others are generated by the master processor. They referesh faster ever 2ms rather than the 17ms for the 1-12 pwms. They are hardware generated. They are to fast for the servos.
I hope it answeres your questions, but if it doesn't then could you explain your quesiton differently?