How to make uploaded program default

Hey guys. I wrote the program for our robot and then uploaded the program to the robot and when I open the program from the brain I can drive it the way I need, but is this going to work in the competition. I mean when they turn the driver control mode is the robot going to execute the program I uploaded or the default one?

When you hook up to the competition switch and load the program you created it will use the driver control of the program you made (There should be a function for driver control and auton if you use the comp template) all it does is switch between functions so when you load the program it will switch to the one you coded

No. The competition control does nothing to start your program for you. You still have to start your program yourself. All competition control does is give your program information on which part of your program should be running by feeding it information, and preventing your program from receiving certain information (joystick) or executing certain commands (mostly motors). Competition templates are just code provided by the makers of your programming software to interpret information provided by competition control.

At no point does competition control start or stop any complete programs on the Brain.

3 Likes

That’s why I mentioned that you have to load the program yourself and the comp switch just switches between the functions

“Load” in the context of programs and Brains usually refers to copying the program to the Brain from the computer.

So, I need to start my program in the competition from the Brain and then it will work fine?

Start your program exactly the same way you would if you weren’t connected to a field.

1 Like

Thanks man but I still have a question, so my controller and motors are configured and in the robot-config.cpp file, but in the main.cpp file there is a usercontrol function where it says it is where I should put my usercontrol code. Should I do anything over there?

Yes, per the documentation, your user control code should go in the usercontrol function in main.cpp. If you are using the graphical robot configuration wizard, you do not need to add any code yourself to robot_config.cpp.

2 Likes