View unanswered posts | View active topics It is currently Mon Oct 20, 2014 5:13 pm






Reply to topic  [ 3 posts ] 
vex competition question 
Author Message
Rookie

Joined: Sat Mar 03, 2012 3:55 pm
Posts: 1
Post 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?


Sat Mar 03, 2012 4:27 pm
Profile
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 405
Post 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.

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Thu Mar 15, 2012 3:18 pm
Profile
Rookie

Joined: Fri Jan 27, 2012 6:57 pm
Posts: 40
Post 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);
   }
}


Sat Mar 24, 2012 2:09 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.