So I was programming the operator control and when i run the code the robot doesn’t seem to respond when driver control is enabled on the Competition Switch.
The code for the operator control is as shows, however I couldn’t find any errors within it…
It looks fine. You don’t even need the switch to run user control. I would try some thing simple like motors on for user control to determine if the problem is with the controller connection. Maybe try no switch which I would be surprised if its broken.
I was just suggesting ways to figure out what the problem is. Just put with in the while loop one line of code which turns on a motor for user control. When you run user control and the motor turns on maybe its the controller input, if the motor doesn’t turn on its another problem.
Ex:
task usercontrol()
{
while (true)
{
motor[frontRight] =100;
}
}
I’ve had problems like this before. I’ve tried everything and nothing worked except for this one silly fix.
[LIST=1]
*]Update all firmware over again. http://www.vexrobotics.com/wiki/Software_Downloads
*]Create a new competition template.
*]Copy and paste old code snippets into the new template.
*]Upload to cortex.
[/LIST]
It could always be a simple syntax error within the code. Sometimes it was just easier for our team to just create a new template and paste our old code there and it would fix the problem.
I have copied our code into a new competition template and the error is still happening…
I have updated the Robot C firmware and master CPU firmware and that hasn’t solved the issue…
I have also added in a print to LCD display line after task operator control and that doesn’t show up which means it isnt reaching that part of the code…
You have no pragma at the top. Go into ‘motor and sensor setup’ and add in all the motors to the correct ports. Let me know if you need more help with that.
Do you mean at the end of the program? If that’s the case, any code after a while(true) will never run.
Try to open one of the example programs, and run that. If the problem persists with that is is hardware issue, possibly the connection or field switch. Also, to run driver control, you never need a field switch. When there is no switch connected, the robot is automatically in driver control.
As has been pointed out, you are missing the pragma at the top. I had assumed that you already configured your motors and sensors (if applicable) and just didn’t copy paste it, but if you haven’t done that, that should fix it.