Comp Control Delay for an Auton Selector

I want a user interface on the V5 controller to choose auton. I already coded it, and no, it’s NOT the ACCESS_OS thing. I made my own.

I want to be able to have the auton chooser go, then AFTER it is done, the competition controls kick in. In other words, the code starts, the chooser works, driver control starts (with no switch), then a comp. switch can be plugged in and run the auton.

My problem is that the auton chooser and the user control run simultaneously, and not in order.

I have this code:

Competition.autonomous( autonomous );
Competition.drivercontrol( usercontrol );

I have these ideas, but no brain to test with for a while (It’s at school. I’m not). I don’t know if they’d work

  1. run ‘chooser’ inside user control*
  2. find a way to not start comp controls until the ‘chooser’ ends

*won’t work because it’ll run once user starts in a competition.

How do I make it work?

You can keep track of whether or not you have selected autonomous yet with a variable. Then test the variable when you enter driver control to see whether you should branch to your autonomous selection or regular driver control code.

1 Like