예제 #1
0
task main()
{
	setupGyro();

	resetAll();	//Stop all motors and reset all sensors

	//1.Preload
	//Pick up First Buckyball
	intake(127, 200);

	//Rotate 90 degrees
	spin(900, 5);
	wait1Msec(500);

	//Dump buckyball
	intake(-127, 1000); //Spin intake for 1 second
	wait1Msec(500);

	//2. Corner Buckys
	//Turn around to collect other buckyballs
	clearGyro();
	spin(1800,5);
	wait1Msec(500);

	//Move toward buckys
	clearDriveEncoders();
	motor[intakeMotor] = 127;
	sonicMove(80, 15);		//Move to 15cm away from buckyball using sonar
	motor[intakeMotor] = 0;

	//3. Deposit Buckys in goal
	resetAll();

	//Turn around 180 degrees
	spin(1800, 5);
	wait1Msec(500);

	//Drive to other side
	clearDriveEncoders();
	drive(100);
	wait1Msec(7000);		//Time based driving at the beginning to get over bump
	clearDriveEncoders();
	sonicMove(100, 30);	//Ultra-sonic takes over

	//Turn to face tube
	clearGyro();
	spin(3150, 2);
	wait1Msec(500);

	//Drive to tube
	sonicMove(50, 15);
}
예제 #2
0
void	resetAll(){		//Stops all motors and resets all sensors
	drive(0);
	intake(0,0);
	arm(0,0);
	slide(0,0);
	wait1Msec(400);
	clearDriveEncoders();
	clearSlideEncoder();
	SensorValue[in6] = 0;
}
예제 #3
0
파일: main.c 프로젝트: EastRobotics/2616E
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.
	}
}