|
|
|
@ -1,4 +1,6 @@
|
|
|
|
|
#pragma config(I2C_Usage, I2C1, i2cSensors)
|
|
|
|
|
#pragma config(Sensor, dgtl1, , sensorSONAR_inch)
|
|
|
|
|
#pragma config(Sensor, dgtl3, , sensorSONAR_inch)
|
|
|
|
|
#pragma config(Sensor, I2C_1, , sensorQuadEncoderOnI2CPort, , AutoAssign )
|
|
|
|
|
#pragma config(Sensor, I2C_2, , sensorQuadEncoderOnI2CPort, , AutoAssign )
|
|
|
|
|
#pragma config(Motor, port1, , tmotorVex393_HBridge, openLoop)
|
|
|
|
@ -276,23 +278,20 @@ task autonomous() {
|
|
|
|
|
driveTiles(1, REVERSE);
|
|
|
|
|
turntoRight(1);
|
|
|
|
|
driveTiles(0.6, REVERSE);
|
|
|
|
|
driveTiles(2.1, FORWARD); // Flip the other cap without turning on the spinner
|
|
|
|
|
driveTiles(2, FORWARD); // Flip the other cap without turning on the spinner
|
|
|
|
|
flipOn(); // So we can pick up the ball that's under it!
|
|
|
|
|
driveTiles(0.5, FORWARD);
|
|
|
|
|
ballIn();
|
|
|
|
|
driveTiles(0.1, REVERSE);
|
|
|
|
|
driveTiles(0.3, REVERSE);
|
|
|
|
|
wait(3);
|
|
|
|
|
driveTiles(0.1, REVERSE);
|
|
|
|
|
turntoLeft(1);
|
|
|
|
|
driveTiles(0.2, REVERSE);
|
|
|
|
|
driveTiles(0.5, REVERSE);
|
|
|
|
|
turntoLeft(0.75);
|
|
|
|
|
//driveTiles(0.2, REVERSE);
|
|
|
|
|
wait(3);
|
|
|
|
|
ballOff();
|
|
|
|
|
shootBall();
|
|
|
|
|
driveTiles(0.05, REVERSE);
|
|
|
|
|
driveTiles(0.33, FORWARD);
|
|
|
|
|
wait(2);
|
|
|
|
|
turntoRight(1);
|
|
|
|
|
driveTiles(2.2, REVERSE);
|
|
|
|
|
turntoRight(0.75);
|
|
|
|
|
driveTiles(1.9, REVERSE);
|
|
|
|
|
turntoLeft(1);
|
|
|
|
|
driveTiles(1, REVERSE);
|
|
|
|
|
turntoRight(1);
|
|
|
|
@ -339,4 +338,3 @@ task usercontrol() {
|
|
|
|
|
// When the driver is in control, this task runs. For the entire duration of the driver control period, we need
|
|
|
|
|
// to be able to control the robot, so we put everything in a while loop. The task calls 2 previously mentioned
|
|
|
|
|
// functions, joystickDrive() and buttonChecks().
|
|
|
|
|
|
|
|
|
|