task usercontrol() {

	while (true) {

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

	while (true)
	{

	  motor[port1] = vexRT[Ch2Xmtr2];
  	motor[port2] = vexRT[Ch3Xmtr2];
  	motor[port3] = vexRT[Ch2Xmtr2];
  	motor[port4] = vexRT[Ch3Xmtr2];
  	motor[port5] = vexRT[Ch2]; // controller 2 control for ports 5 6 7 and 8
  	motor[port6] = vexRT[Ch2];
  	motor[port7] = vexRT[Ch3];
		motor[port8] = vexRT[Ch3];
	  // This is the main execution loop for the user control program. Each time through the loop
	  // your program should update motor + servo values based on feedback from the joysticks.

	  // .....................................................................................
	  // Insert user code here. This is where you use the joystick values to update your motors, etc.
	  // .....................................................................................

	  UserControlCodePlaceholderForTesting(); // Remove this function call once you have "real" code.
	}
}
Beispiel #3
0
task usercontrol()
{
	// User control code here, inside the loop
	//targetValue = 10000;
	//startTask(driveBase);
	//startTask(arm);
	//startTask(drive);
	while (true)
	{
	  // This is the main execution loop for the user control program. Each time through the loop
	  // your program should update motor + servo values based on feedback from the joysticks.

	  // .....................................................................................
	  // Insert user code here. This is where you use the joystick values to update your motors, etc.
	  // .....................................................................................
//		motor[port1]=motor[port2]=vexRT[Ch1];
//		motor[port3]=motor[port4]=vexRT[Ch3];
	//targetValue=4000;
	//startTask(driveBase);
	
		
	//rightArmTarget = SensorValue[rightPot];
  //leftArmTarget = SensorValue[leftPot];

  //rightArmTarget = 25;
  //leftArmTarget = 25;
  //startTask(armPID);
	drive();

	  UserControlCodePlaceholderForTesting(); // Remove this function call once you have "real" code.
	}
}
task usercontrol()
{
	//No user control code needed except the lines of code below this comment
	while (true)
	{
	  UserControlCodePlaceholderForTesting();
	}
}
Beispiel #5
0
task usercontrol()
{
	// User control code here, inside the loop

	while (true)
	{
	 //iWantPizza

	  UserControlCodePlaceholderForTesting(); // Remove this function call once you have "real" code.
	}
}
task usercontrol()
{
	if (false) UserControlCodePlaceholderForTesting();

	initialize();

	while (true)
	{
		processController();


	}
}
Beispiel #7
0
task usercontrol()
{
	// User control code here, inside the loop

	while (true)
	{
	  // This is the main execution loop for the user control program. Each time through the loop
	  // your program should update motor + servo values based on feedback from the joysticks.

	  // .....................................................................................
	  // Insert user code here. This is where you use the joystick values to update your motors, etc.
	  // .....................................................................................

	  UserControlCodePlaceholderForTesting(); // Remove this function call once you have "real" code.
	}
}
Beispiel #8
0
void pre_auton()
{
	bStopTasksBetweenModes = true; // Tasks stop when we need them to. Not doing this can be dangerous.
	bLCDBacklight = true; // Turn our LCD backlight on

	//Reset the motor encoders
	clearDriveEncoders();

	//Setup song
	processSong();

	// Never passing if statement. Lets us get rid of compile warnings so we can focus on the ones we need to see.
	if (false) {
		UserControlCodePlaceholderForTesting();
		AutonomousCodePlaceholderForTesting();
		sensorsErrorEscape(); // Get rid of unused methods for the sensor lib
		// Feel free to add currently un-used methods/tasks here if you're sure they are meant to not be used.
	}
}
Beispiel #9
0
task usercontrol() {
	{

		int beltSpeed = 0;
		while (true) {
			int x  = vexRT[Ch1];  // Right Joystick X value
			int y = vexRT[Ch3];   // Left Joystick Y value

			if (abs(x) < 10) {
				x = 0;
			}
			if (abs(y) < 10) {
				y = 0;
			}

			int speed = y;

			int differential = -x;

			writeDebugStreamLine("Speed: ", speed);
			writeDebugStreamLine("Diff: 	", differential);
			int right = speed + differential;
			int left = speed - differential;

			writeDebugStreamLine("R: ", right, "; L: ", left);

			if (right > 127) {
				right = 127;
			}
			if (right < -128) {
				right = -128;
			}
			if (left > 127) {
				left = 127;
			}
			if (left < -128) {
				left = -128;
			}

			int frontLeft = left;
			int frontRight = right;
			int backLeft = left;
			int backRight = right;

			int mech = vexRT[Ch4];  // Left Joystick X value
			if (abs(mech) < 10) {
				mech = 0;
			}

			frontLeft += mech;
			frontRight += mech;

			backLeft -= mech;
			backRight -= mech;

			if (frontLeft < -128) {
				frontLeft = -128;
			}
			if (frontRight < -128) {
				frontRight = -128;
			}
			if (backLeft < -128) {
				backLeft = -128;
			}
			if (backRight < -128) {
				backRight = -128;
			}
			if (frontLeft > 127) {
				frontLeft = 127;
			}
			if (frontRight > 127) {
				frontRight = 127;
			}
			if (backLeft > 127) {
				backLeft = 127;
			}
			if (backRight > 127) {
				backRight = 127;
			}
			motor[frontLeftMotor] = frontLeft;
			motor[backLeftMotor] = backLeft;
			motor[frontRightMotor] = frontRight;
			motor[backRightMotor] = backRight;

			if (vexRT[Btn5U] == 1) {
				beltSpeed = 64;
				} else if (vexRT[Btn5D] == 1) {
				beltSpeed = 0;
			}
			motor[beltMotor1] = beltSpeed;
			motor[beltMotor2] = beltSpeed;

			if (vexRT[Btn8U] == 1) {
				shootingMotorSpeed = 127;
				startTask(setShooting);
				} else {
				shootingMotorSpeed = 0;
				startTask(setShooting);
			}
		}

		UserControlCodePlaceholderForTesting();
	}
}
Beispiel #10
0
/////////////////////////////////////////////////////////////////////////////////////////
//
//                          Pre-Autonomous Functions
//
// You may want to perform some actions before the competition starts. Do them in the
// following function.
//
/////////////////////////////////////////////////////////////////////////////////////////
void warningKiller() {
	UserControlCodePlaceholderForTesting();
	AutonomousCodePlaceholderForTesting();
}