Update 'main.c'

master
Cole Deck 6 years ago
parent 79b42cae9a
commit 52471a17a5

@ -178,37 +178,40 @@ void driveTiles(float numberOfTiles, bool direction) {
motor[driveRF] = 0;
}
task autonomous() {
turntoRight(0.05);
turntoRight(0.03);
shootBall();
turntoLeft(0.05);
turntoLeft(0.03);
driveTiles(2, FORWARD); // Move 2 forward to hit bottom flag
driveTiles(1, REVERSE);
turntoRight(1);
driveTiles(0.5, REVERSE); // Drive 1/3 of a tile backwards to hit the wall and align ourselves!
flipOn(); // Turn on the ball intake in reverse, which is what we can use to flip the caps
driveTiles(1.5, FORWARD); // flip cap
driveTiles(1.6, FORWARD); // flip cap
ballOff();
driveTiles(1.25, REVERSE);
driveTiles(1.35, REVERSE);
turntoLeft(1);
driveTiles(1, REVERSE);
turntoRight(1);
driveTiles(0.6, REVERSE);
driveTiles(2.5, FORWARD); // Flip the other cap without turning on the spinner
driveTiles(2.1, FORWARD); // Flip the other cap without turning on the spinner
flipOn();
driveTiles(0.5, FORWARD);
driveTiles(0.1, FORWARD);
ballIn(); // So we can pick up the ball!
ballIn();
driveTiles(0.1, REVERSE);
// So we can pick up the ball!
wait(3);
driveTiles(0.1, FORWARD);
driveTiles(0.1, REVERSE);
turntoLeft(1);
driveTiles(0.25, REVERSE);
driveTiles(0.2, REVERSE);
wait(3);
ballOff();
shootBall();
driveTiles(0.25, FORWARD); // Hit middle column bottom flag
driveTiles(0.05, REVERSE);
driveTiles(0.33, FORWARD); // Hit middle column bottom flag
//driveTiles(2, REVERSE);
wait(2);
turntoRight(1);
driveTiles(2.5, REVERSE);
driveTiles(2.2, REVERSE);
turntoLeft(1);
driveTiles(1, REVERSE);
turntoRight(1);

Loading…
Cancel
Save