Recently, my team has had an issue with the competition switch, that if we start in driver control (or the competition cable is unplugged) and then the robot is disabled, pre_auton doesn’t run, causing nothing to be calibrated or the LCD code to run. How would it be possible to call pre_auton every time the robot switches into disabled mode? Would I have to edit the competition template and include file, or is there a better way to do this.
Proper tournament procedures is to plug in prior to turning the robot on. So you start in disabled.
I think you must be confused though. If you start in driver control your pre_auton function did run. It sounds like you are ending pre auton yourself even though you don’t seem to want to.
I posted the relevant code here. I want to make it that if I start in driver control, the LCD Code doesn’t run, but then when the robot is disabled, pre_auton runs again, running the LCD Code.
O that is an interesting approach. I had read that thread back when it came out but hadn’t thought of it since.
I was going to recommend just moving the LCD selection to its own task. This code
with
stopTask(LCDControl);
removed from usercontrol. That way the competition code would still be used and the LCD would run through usercontrol and disabled.
They are effectively the same thing. A task in the backround to monitor stuff but I wouldn’t have wanted to bypass the ROBOTC competition control just to have to re-implement it.