I’ve been trying to write some code for our v5 robot that came the other day in vex c++, and I want to start practicing writing in the competition template. I can’t seem to find it online anywhere? Does anyone know where I can find it?
- Open VCS
- Go to example programs.
- Scroll all the way down
- Open up comp template and choose your language
We competed 2 weeks ago and were having trouble finding a competition template. If you look at the example projects in VCS, you will find a competition example. The students were changing the code in this VCS competition example but it would not save! So I contacted VEX directly and was told that there is not a competition template available for now and it will be available in December 2018. So sadly our V5 robots have only been competing with joystick control and no autonomous.
To add to what @DanDanrevolution said,
5. Copy the competition code.
6. Create a new project.
7. Paste all that code over what starts in main.cpp.
@callen - Wow I can’t believe it was that simple. Thank you so much! Why did VEX tell me I couldn’t do autonomous with V5 until December? I appreciate your help.
perhaps they thought you meant a template for VCS Modkit blocks, that’s not available yet.
It could be what @jpearman said. It could be they were thinking of a “template” instead of example code, and as far as I’m aware there is no template as far as normal terminology is concerned, but maybe there is a real template coming out.
We are getting an error from the competition template file, even before making any changes.
//Creates a competition object that allows access to Competition methods. vex::competition Competition;
Throws this error:
13:53:27 -- error -- In file included from cxx_entry.cpp:16: ./main.cpp:9:21: error: redefinition of 'Competition' vex::competition Competition; ^ ./robot-config.h:12:18: note: previous definition is here vex::competition Competition;
It disappears when I un-capitalize “Competition”. However, I am concerned about making a change here if it may mess up how this works with the competition control system, which we can not test before the actual competition.
Either delete the line
or uncheck the competition checkbox under the dropdown menu.
I just tested both samples and they were working unless you went in and checked the checkbox (which we need to fix)
@CriticalError I got my template working by renaming Competition to something else. I guess ‘Competition’ is an function or variable a system class?