Exemplo n.º 1
0
void worldsBlue ()
{

// variables
	int armMin = 300;
	int wallHeight = 100;
	int goalHeight = 1550;
	int dead1 = 1000;
	int dead2 = 2000;
	int dead3 = 3000;
	int pot = analogRead (8);


	int encoder1 = 1500; //drive under wall
	int encoder2 = 136; // rotate 90 degrees
	int encoder3 = 900; // backwards to the opponets goal
	int encoder4 = 400; //turn to goal + enclose it


	// begin routine

	intakeDead(); // unfold
	delay(300); // needs to clear the wall..
	driveBack (encoder1); // drive backwards to under the bridge
	stopIntake();
	turnLeft (encoder2); // turn ass to opponets goal
	driveBack (encoder3); // drive to opponets goal
	driveBackDead(); // push them
	delay (200);
	stopDrive ();
	delay (7000); // wait till auto end
	driveBackDead ();// push them
	delay (600);
	stopDrive();
	delay(100);
	driveForwardDead(); // driveback towards goal
	delay(400);
	stopDrive ();
	armUp(goalHeight); //arm up
	scrapeLeft (encoder4);  //encase the goal
	outtake (300);

	stopAll ();

}
Exemplo n.º 2
0
void reverse15Red()
{
	// variables
			int armMin = 300;
			int wallHeight = 1000;
			int goalHeight = 1550;
			int pot = analogRead (8);


			int encoder1 = 1200; //drive under wall
			int encoder2 = 136; // rotate 90 degrees
			int encoder3 = 1300; // backwards to the opponets goal
			int encoder4 = 900; //turn to bridge
			int encoder5 = 200; // knock their wallball
			int encoder6 = 200; // turn to other ball
			int encoder7 = 400; // knock their center ball
			int encoder8 = 400; // positioning



			// begin routine

			intakeDead(); // unfold
			delay(300); // needs to clear the wall..
			driveBack (encoder1); // drive backwards to under the bridge
			stopIntake();
			turnRight (encoder2); // turn ass to opponets goal
			driveBack (encoder3); // drive to opponets goal
			driveBackDead(); // 90 deg align
			delay(400);
			stopDrive ();
			armUp(wallHeight);// arm up
			scrapeLeft (encoder4); // turn to wall ball
			driveForward (encoder5); // knock off wall ball
			scrapeLeftBack(encoder6); // turn to middle ball
			driveForward(encoder7); // knock off middle ball
			driveBack (encoder8); // positioning

			stopAll ();




}
Exemplo n.º 3
0
void rejectionBlueSkills()
{

	// variables
	int armMin = 300;
	int wallHeight = 1000;
	int goalHeight = 1700;
	int pot = analogRead(8);
	int midLine = analogRead(2);

	int encoder1 = 1800; //drive under wall
	int encoder2 = 130; // rotate 90 degrees
	int encoder3 = 1400; // backwards to the opponets goal
	int encoder4 = 270; //turn to center of large balls
	int encoder5 = 200; //hit 1st blue ball off
	int encoder55 = 300; // back a bit
	int encoder6 = 450; //hit 2nd ball off
	int encoder7 = 450; // drive back past line
	int encoder8 = 160; // turn to line

	// begin routine

	intakeDead(); // unfold
	delay(300); // needs to clear the wall..
	driveBack(encoder1); // drive backwards to under the bridge
	stopIntake();
	turnLeft(encoder2); // turn ass to opponets goal
	driveBackDead(encoder3); // drive to opponets goal
	delay(500);

	midLine = 3000;
	while (midLine > 2000)
	{
		midLine = analogRead(2);
	}

	motorSet(MOTOR_DRIVE_RIGHT_BACK, 10); // no inertia
	motorSet(MOTOR_DRIVE_RIGHT_FRONT, 10);
	motorSet(MOTOR_ARM_LEFT_BACK, 10);
	motorSet(MOTOR_ARM_LEFT_FRONT, 10);
	delay(85);

	armUp(wallHeight); // arm up
	turnRight(encoder4); // turn towards center of large balls
	driveForwardSlowDead(); // go between large balls
	delay(1200);
	stopDrive();
	delay(300);
	turnLeft(encoder5); //hit center ball
	driveBackSlow(encoder55);
	turnRight(encoder6); // hit far ball
	driveBackSlow(encoder7); // back up past line
	turnRight(encoder8); // tun to line

	armUp(goalHeight);

	findLineLeft();
	//followLine(300);

	driveForwardDead(); // drive to goal
	delay(700);
	stopDrive();
	outtake(3000);

	stopAll();
	delay(60000);

}
Exemplo n.º 4
0
void kakitRed()
{

// variables
	int armMin = 300;
	int wallHeight = 1000;
	int goalHeight = 1650;

	int pot = analogRead(8);

	int encoder00 = 250; // back up abit to row
	int encoder0 = 950; // turn 360 degrees, knock off buckys, face line
	int encoder1 = 162; // rotate towards 2 buckys
	int encoder2 = 150; // drive towards buckys
	int encoder3 = 400; // back up to bump
	int encoder4 = 200; // back up towards bridge
	int encoder5 = 360; // rotate 180 degrees to the large ball
	int encoder6 = 900; // go under bridge and knock out large ball
	int encoder7 = 90; // turn to goal
	int encoder8 = 200; // drive to goal
	int encoder9 = 75;

	// begin routine
	intake(300);
	armDownTrim();

	driveForwardDead(); //ram big balls
	delay(1500);
	stopDrive();
	delay(500);

	driveBack(encoder00); // back up to row abit
	intakeDead();

	turnLeft(encoder0); // turn 360 degrees

	driveBackDead(); // drive back + wall align
	delay(1300);
	stopDrive();
	delay(500);

	turnRight(encoder1); // turn to two buckys
	intakeDead();

	followLine(300); // make sure ur straight

	driveForwardSlowDead(); // drive towards buckys
	delay(500);
	stopDrive();
	delay(600);

	driveForwardDead(); //get the 2nd ball
	delay(200);
	stopDrive();
	delay(600);

	stopIntake();

	driveBack(encoder3); // back up to bump

	armUpDead(); // armup
	delay(50);
	stopArm();
	stopIntake();

	driveBackSlowDead(); // allign the bump
	delay(300);
	stopDrive();
	delay(500);

	driveBackDead();  // over the bump
	delay(1000);
	stopDrive();
	delay(500);

	driveForwardSlowDead(); // alighn to bump
	delay(800);
	stopDrive();
	delay(500);

	driveBackSlow(encoder4); // back up towards bridge
	turnLeft(encoder5); // rotate 180 degrees to the large ball
	armDown(armMin);
	armDownTrim();

	driveForward(encoder6); // go under the bridge + knock large ball
	armUp(goalHeight);

	turnRight(encoder7); // turn to goal

	findLineRight();
	followLine(300);

	driveForwardSlowDead(); // drive to goal
	delay(700);
	stopDrive();
	outtake(7000); // outtake 3

	stopAll();

}
Exemplo n.º 5
0
void rejectionBlue()
{

	// variables
	int armMin = 300;
	int wallHeight = 1000;
	int goalHeight = 1700;
	int pot = analogRead(8);
	int midLine = analogRead(2);

	int encoder1 = 1800; //drive under wall
	int encoder2 = 130; // rotate 90 degrees
	int encoder3 = 1400; // backwards to the opponets goal
	int encoder4 = 100; //turn to goal + enclose it
	int encoder5 = 450; //hit 1st blue ball off
	int encoder6 = 350; // drive back
	int encoder7 = 175; // turn to 2nd blue ball
	int encoder8 = 550; // hit 2nd ball off
	int encoder9 = 250; // drive back to position
	int encoder10 = 370; // rotate to line

	// begin routine

	intakeDead(); // unfold
	delay(300); // needs to clear the wall..
	driveBack(encoder1); // drive backwards to under the bridge
	stopIntake();
	turnLeft(encoder2); // turn ass to opponets goal
	driveBackDead(encoder3); // drive to opponets goal
	delay(500);

	midLine = 3000;
	while (midLine > 2000)
	{
		midLine = analogRead(2);
	}

	motorSet(MOTOR_DRIVE_RIGHT_BACK, 10); // no inertia
	motorSet(MOTOR_DRIVE_RIGHT_FRONT, 10);
	motorSet(MOTOR_ARM_LEFT_BACK, 10);
	motorSet(MOTOR_ARM_LEFT_FRONT, 10);
	delay(85);

	armUp(wallHeight); // arm up
	turnRight(encoder4); // turn towards center blue ball
	driveForward(encoder5); // hit 1st ball off
	delay(700);
	driveBack(encoder6); // back
	delay(700);
	turnRight(encoder7); // turn towards 2nd blue ball
	delay(700);
	driveForward(encoder8); // hit off 2nd blue ball
	delay(700);
	intakeDead();
	driveBack(encoder9); // position
	delay(700);
	turnLeft(encoder10); // encase opponet goal
	delay(700);
	armUp(goalHeight);

	findLineRight();
	//followLine(300);

	driveForwardDead(); // drive to goal
	delay(700);
	stopDrive();
	outtake(3000);

	stopAll();
	delay(60000);

}
Exemplo n.º 6
0
void rushBlue ()
{


	// variables
		int armMin = 300;
		int wallHeight = 1000;
		int goalHeight = 1700;
		int pot = analogRead (8);
		int midLine = analogRead(2);


		int encoder1 = 1800; //drive under wall
		int encoder2 = 130; // rotate 90 degrees
		int encoder3 = 1400; // backwards to the opponets goal
		int encoder4 = 630; //turn to goal + enclose it


		// begin routine

		intakeDead(); // unfold
		delay(300); // needs to clear the wall..
		driveBack (encoder1); // drive backwards to under the bridge
		stopIntake();
		turnLeft (encoder2); // turn ass to opponets goal
		driveBackDead(encoder3); // drive to opponets goal
		delay(500);

		midLine = 3000;
		while (midLine > 2000)
		{
			midLine = analogRead(2);
		}

		motorSet (motor1, 10)	; // no inertia
		motorSet (motor2, 10)	;
		motorSet (motor10, 10)	;
		motorSet (motor9, 10)	;
		delay (85);


		//driveBackDead(); // push them
		//delay (300);
		stopDrive ();
		delay (7000); // wait till auto end
		driveBackDead ();// push them
		delay (800);
		stopDrive();
		delay(100);
		driveForwardDead(); // driveback towards goal
		delay(300);
		stopDrive ();
		intakeDead();
		armUp(goalHeight); //arm up
		scrapeLeft (encoder4);  //encase the goal
		driveForwardSlowDead ();
		delay(700);
		stopDrive();
		outtake (3000);

		stopAll ();


}