We have three codes, one for the competition, one for driver skills, and one for the 60 second autonomous skills. However, when we try to download them, only one can download at a time. For example, if I first download my competition code, and then my driver skills code, my driver skills code replaces my competition code. Is there anyway I could download all three of them onto the cortex? Also, is there any way I could use the LCD display to choose between the three?
Thanks
You should be able to merge your competition program and robot skills program by having all your controller related functions called in the usercontrol task of the competition template. As for the LCD, I would suggest doing some research to find simple LCD code that lets you flip between different autonomous selections. You could add your prog run in there. You would just have the LCD selection process run in pre-auton (when the robot is disabled) to assign a variable and use a case switch with that variable as the input in the autonomous task of the competition control. For example, I’ve set up my LCD code to start up when the robot’s disabled and return an integer variable. My selection has 4 original selections (no auton, red autons, blue autons, programming), and several more auton selections after choosing red or blue. Once selected, the variable is assigned a value that is selected in the autonomous period. When we are running skills, we plug into the comp switch and select before the run is started. All the driver control related functions are placed in the usercontrol task which makes them usable both in competition and robot skills. Hope this helps!
So do I have to merge the codes? Is there no way to have 3 different codes on a cortex at once?
Correct, you can only have one on a time.
Alright, this makes sense. Now, my usercontrol code is the same in both my competition file and my driver skills file. However, I did notice that there are some differences between the two files, with the pragma configuration for the driver skills template being this
#pragma platform(VEX)
#pragma competitionControl(Competition)
#pragma autonomousDuration(0)
#pragma userControlDuration(60)
and the competition template being this
#pragma platform(VEX2)
#pragma competitionControl(Competition)
So when I go to play a driver skills match, can I simply use the same competition code, and it will detect that I’m playing a driver skills match? Or is it that due to the difference above, I need to keep them separate?
Thanks
A competition template will work for matches, skills of both types, and practice. The field controls will override when you can and can’t move for matches and both types of skills runs.
As far as autons, I recommend using a LCD screen, or potentiometers, to make an auton chooser. This will let you select when you want to run your match auton(s), or your skills auton. You could also use jumpers, or a variety of sensors. Worst case, comment out the autons you’re not using at the time, and download the code with the one you want to run at that time not commented out.
You can just use your competition code. The Field Control at your tournament will disable your robot after 60 seconds (Same goes for Programming Skills), so there is no need to have the duration pragmas.
@Tegicupala
These 2 don’t do anything (left over code from previous versions) and they are the only difference.
#pragma autonomousDuration(0)
#pragma userControlDuration(60)