View unanswered posts | View active topics It is currently Fri Aug 01, 2014 11:55 am






Reply to topic  [ 2 posts ] 
RobotC coding help 
Author Message
Rookie

Joined: Mon Apr 29, 2013 1:41 pm
Posts: 1
Post RobotC coding help
Hello. I currently am coding for the current Vex competition. However my automonous code is not running and I do not know why. I currently running Vex cortex 2.0 with RobotC 3.54.

the code is below


#pragma config(Motor, port2, frontRight, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port3, backRight, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port4, frontLeft, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor, port5, backLeft, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor, port6, mainBelt, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port7, sideRight, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port8, sideLeft, tmotorServoContinuousRotation, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

#pragma platform(VEX)

//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!

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.
bStopTasksBetweenModes = true;

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

}

task autonomous()
{
motor[mainBelt] = 127;
motor[sideRight] = 127;
motor[sideLeft] = 127;
wait1Msec(20000);
}

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

while (true)
{
//Remote Control Commands
motor[frontRight] = vexRT[Ch3] - vexRT[Ch1] - vexRT[Ch4];
motor[backRight] = vexRT[Ch3] - vexRT[Ch1] + vexRT[Ch4];
motor[frontLeft] = vexRT[Ch3] + vexRT[Ch1] + vexRT[Ch4];
motor[backLeft] = vexRT[Ch3] + vexRT[Ch1] - vexRT[Ch4];
}
}

if any one can help, it be great appreciated.


Mon Apr 29, 2013 1:46 pm
Profile
Rookie

Joined: Wed Feb 09, 2011 1:08 am
Posts: 27
Post Re: RobotC coding help
are you using a competition switch simulator?

What are you trying that this does not work?

Cheers Kb


Fri May 03, 2013 7:42 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 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.