User control and Autonomous

I’m sure there is already a topic for this somewhere, but I was not able to find it. How do I create the code for having autonomous and user control in the same program so that the competition switch works without having to touch the robot at all?

Use the competition template. Go to open then templates. Scroll down till you find it. Put your auton in the autonomous section and your driver control code in the usercontrol section.