View unanswered posts | View active topics It is currently Wed Sep 03, 2014 12:47 am






Reply to topic  [ 4 posts ] 
Autonomous to User Control 
Author Message
Rookie

Joined: Tue Oct 29, 2013 11:55 am
Posts: 1
Post Autonomous to User Control
My team has code for a test robot but with the competition template it skips the autonomous code and goes to user control


Code:
#pragma config(Motor,  port1,            ,             tmotorVex393, openLoop, reversed)
#pragma config(Motor,  port9,            ,             tmotorVex393, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(20)
#pragma userControlDuration(120)

#include "Vex_Competition_Includes.c"   //Main competition background code...do not modify!

/////////////////////////////////////////////////////////////////////////////////////////
//
//                          Pre-Autonomous Functions
//
// You may want to perform some actions before the competition starts. Do them in the
// following function.
//
/////////////////////////////////////////////////////////////////////////////////////////

void pre_auton()
{
  // Set bStopTasksBetweenModes to false if you want to keep user created tasks running between
  // Autonomous and Tele-Op modes. You will need to manage all user created tasks if set to false.

   // All activities that occur before the competition starts
   // Example: clearing encoders, setting servo positions, ...
}

/////////////////////////////////////////////////////////////////////////////////////////
//
//                                 Autonomous Task
//
// This task is used to control your robot during the autonomous phase of a VEX Competition.
// You must modify the code to add your own robot specific commands here.
//
/////////////////////////////////////////////////////////////////////////////////////////

task autonomous()
{
   motor[port1] = 50;
   motor[port10] = 50;
   wait10Msec(1000);

   motor[port1] = 50;
   motor[port10] = -50;
   wait10Msec(1000);

   motor[port1] = -50;
   motor[port10] = 50;
   wait10Msec(1000);

   motor[port1] = -100;
   motor[port10] = 100;
   wait10Msec(1000);

   motor[port1] = 50;
   motor[port10] = 50;
   wait10Msec(2000);

   motor[port1] = 50;
   motor[port10] = -50;
   wait10Msec(1000);
}

/////////////////////////////////////////////////////////////////////////////////////////
//
//                                 User Control Task
//
// This task is used to control your robot during the user control phase of a VEX Competition.
// You must modify the code to add your own robot specific commands here.
//
/////////////////////////////////////////////////////////////////////////////////////////

task usercontrol()
{
   // User control code here, inside the loop

   while(true)
   {
      motor[port1] = vexRT[Ch2] / 2;
      motor[port10] = vexRT[Ch3] / 2;

      //Arm Control
      if(vexRT[Btn6U] == 1)
      {
         motor[port2] = 125;
         motor[port9] = 125;
      }
      else if(vexRT[Btn6D] == 1)
      {
         motor[port2] = -125;
         motor[port9] = -125;
      }
      else
      {
         motor[port2] = 0;
         motor[port9] = 0;
      }
   }
}


Tue Oct 29, 2013 11:58 am
Profile
Site Admin
Site Admin
User avatar

Joined: Tue Oct 09, 2012 10:34 am
Posts: 192
Post Re: Autonomous to User Control
Hi joshm4789,
Your robot is not receiving any commands telling it to switch to autonomous mode. You either need a VEXnet Competition Switch or you can use the ROBOTC debugger.

Best,
--Ryan

_________________
Ryan Cahoon
CMU Robotics Academy
RVW Software Developer

Robot Potato Head; Virtual NXT


Tue Oct 29, 2013 2:57 pm
Profile
Rookie

Joined: Fri Apr 04, 2014 8:33 am
Posts: 2
Post Re: Autonomous to User Control
I am an advisor for two new TSA VEX teams and we seem to be having a similar problem. I am posting one teams programs to this reply.


Attachments:
File comment: Cannot get autonomous to trigger using stated buttons. Program goes straight to user control, optical encoders are not working as intended.
The final count down robot - Connor.txt [5.29 KiB]
Downloaded 46 times
File comment: Cannot get autonomous to trigger using the stated buttons. Program goes straight to user control.
Simon's New Competition format VEX - Copy.txt [7.97 KiB]
Downloaded 46 times
Fri Apr 04, 2014 8:55 am
Profile
Site Admin
Site Admin
User avatar

Joined: Tue Oct 09, 2012 10:34 am
Posts: 192
Post Re: Autonomous to User Control
Hi kowens,
I responded to your post in your other thread.

--Ryan

_________________
Ryan Cahoon
CMU Robotics Academy
RVW Software Developer

Robot Potato Head; Virtual NXT


Fri Apr 04, 2014 11:05 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 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.