ROBOTC.net forums
http://www.robotc.net/forums/

vex competition question
http://www.robotc.net/forums/viewtopic.php?f=53&t=4309
Page 1 of 1

Author:  BDWC [ Sat Mar 03, 2012 4:27 pm ]
Post subject:  vex competition question

Is there a way I con configure my competition code to run Autonomous then driver controled like it would in a real competition so our group can practice?

Author:  jbflot [ Thu Mar 15, 2012 3:18 pm ]
Post subject:  Re: vex competition question

If you keep your robot connected to the computer over VEXnet, you can use the "Competition Control" debug window. Go to Robot > Debug Windows > Competition Control.

Author:  sumasmreq [ Sat Mar 24, 2012 2:09 pm ]
Post subject:  Re: vex competition question

We have code in our program that let's us press a button on the LCD screen to start Autonomous. You could do something similar (have two buttons on the joystick which when pressed start Autonomous):
Code:
if (vexRT[Btn5U] && vexRT[Btn5D])
{
   StopTask(usercontrol);
   StartTask(autonomous);
}


Then if you want to be able to regain control after Autonomous is finished, add this at the end of you Autonomous code: (It'll start operator code when you hit a joystick; this has the benefit of not moving you into operator code prematurely during a competition, because the joysticks are disabled then)

Code:
#define JOYSTICKDEADZONE 20
while(true)
{
   if (abs(vexRT[Ch1]) > JOYSTICKDEADZONE || abs(vexRT[Ch2]) > JOYSTICKDEADZONE || abs(vexRT[Ch3]) > JOYSTICKDEADZONE || abs(vexRT[Ch4]) > JOYSTICKDEADZONE)
   {
      StartTask(usercontrol);
      StopTask(autonomous);
   }
}

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/