A recent thread asked whether pneumatics could be used after the 15 seconds, which was ruled as not being allowed.
However, I was wondering if this is even possible. I know that in disabled mode the pneumatics will stay in whatever state they were before. However, I thought that the program is also stopped, meaning that no code will execute after the 15 seconds and pneumatics will stay however they were at 15 seconds. Is this correct, or is it possible to use pneumatics after disabled?
I have not tested this at all, but would like to throw out some ideas for others, and myself (once I get access our Vex stuff) to test.
There is a method in robotC called “stopTasksBetweenModes” that determines weather user tasks stop between modes. I believe that if this is true, all tasks will be stopped, including those that hold pneumatics out. this means that the pneumatics would change states at the end of autonomous because the field was disabled. However, if this was false, although all motors were stopped by another function in the competition include file, the pneumatic would retain its state.
Another thought is the question of weather tasks will continue running while all functions will stop.
Again, I have not tested this, but am just sharing ideas and thoughts at this time
You have to remember that there is nothing special or clever about the competition templates. They are just pre-made main tasks (I’m talking ROBOTC here) that monitor the information that field control sends out. The template then decides which other tasks to start and stop based on these modes. I have posted alternative versions of the competition template before that have slightly different functionality (allowing LCD and things like that to keep running).
The motors are the only things that the master processor will absolutely stop when field control is disabled, everything else will still function. I’m sure this has been abused in the past, but then again, I often see that when power is removed from a motor a robot will still continue to move and sometimes score after the 15 second autonomous period has finished.
Be smart with this knowledge, don’t abuse it, keep the competition honest.
The code can be stopped as soon as the field control unit says that autonomous is disabled, not after 15 seconds
// Waiting for autonomous phase to end
while (bIfiAutonomousMode && !bIfiRobotDisabled)
if (nVexRCReceiveState == vrNoXmiters) // the transmitters are powered off!!
wait1Msec(25); // Waiting for autonomous phase to end