Esempio n. 1
0
task main()
{
	//initializeRobot();
	waitForStart();
	drive(0, 100, 0);		// drive forward off ramp
	servoUp();					// talons up
	wait1Msec(2950);
	servoDown();				// talons down
	wait1Msec(450);
	drive(-50, -35, 75);// spin around goal
	wait1Msec(1250);
	drive(75, 20, 75);	// spin even harder
	wait1Msec(1200);
	drive(50, 100, 40);	// spin less drive more
	wait1Msec(3000);
	drive(0, 100, 0);		// drive those last couple feet
	wait1Msec(650);
}
task main()
{
  initializeRobot();
  //waitForStart();
  wait1Msec(delay);
  goForward(2000);
  spinLeft(500);
  goForward(3000);
  servoUp();
  liftUp(3000);
  drawerUp(4000);
  spinLeft(1000);
  goForward(3000);
  goLeft(2000);
  goForward(1000);
  servoDown();
  goBackward(1000);
  goLeft(3000);
  goForward(4000);
  while (true){}
}
Esempio n. 3
0
task main()
{
	eraseDisplay();
	bool i = inputWaitForStart();//check for wait for start
	wait1Msec(500);

	if(i)
	{
		waitForStart();
	}

	initializeRobot();
	/*
	nMotorEncoder[left] = 0;
	while(abs(nMotorEncoder[left]) < inchesToEncoder(32))
	{
		motor[right]=100;
		motor[left] = 0;
		PlaySound(soundBeepBeep);
	}

	stopMotors();
	return;
	*/

	driveInches(88,35,35); //drive to tube
	wait1Msec(500);
	servoDown();
	wait1Msec(500);
	driveInches(-5);
	raiseLift();
	wait1Msec(500);
	dump();
	wait1Msec(500);
	dumpUp();
	wait1Msec(500);
	// turn around and drive to ramp
	nMotorEncoder[left] = 0;
	//start of floor code
		//turn around and drive to ramp
	nMotorEncoder[right] = 0;
	//start of floor code
	//go flat against wall
	while(abs(nMotorEncoder[right]) < inchesToEncoder(20))
	{
		motor[left]= 50;
		motor[right] = -50;

		print(nMotorEncoder[left], 4);

	}

	//turn towards floor parking zone
	motor[left]= 100;
	motor[right] = 0;
	wait1Msec(200);
	motor[left] = 0;

	//drive to parking zone
	driveInches(120,50,50);
	//release thingy
	servoUp();
	return;
	//start of ramp code
	while(abs(nMotorEncoder[left]) < inchesToEncoder(64))
	{
		motor[right]=100;
		motor[left] = 0;
	}

	stopMotors();

	//driveInches(4);
	//driveInches(40,50,0);
	turn(LEFT, 40);
	driveInches(257,100,100);
	turn(RIGHT, 30);
	wait1Msec(5000);
	PlaySound(soundFastUpwardTones);
	driveInches(30, 50, 50);
	wait1Msec(500);
	turn(LEFT, 30);
	wait1Msec(500);
	driveInches(30, 50, 50);
	servoUp();
	//drive back off of ramp
	driveInches(-90);
}