text
stringlengths
0
715
aDrive(100);
}
if (WallDistance.objectDistance(inches) < 54){
aDrive(100);
}
if (WallDistance.objectDistance(inches) < 54){
aDrive(100);
}
Intake.stop();
} else if (autonType == 5) {
//programming skills
//intitial setup
aDrive(-700);
driveDistance = 60;
turnPID(true);
//match loading
kickerOn = true;
turnPID(true);
speedPID = 1;
wait(24, sec);
Controller1.rumble(rumbleShort);
wait(3, sec);
//turn and drive
kickerOn = false;
aTurn(-55);
aDrive(1450);
driveDistance = -138;
turnPID(true);
turnPID(true);
aDrive(-4100); //drive under elevation bar
aTurn(25);
aDrive(-1500);
aTurn(50);
//push triballs in goal
aDriveFor(-20, 200);
aDriveFor(-50, 300);
aDriveFor(-100, 400);
wait(300, msec);
//line up for main push on right
aDrive(400);
driveDistance = -146;
turnPID(true);
turnPID(true);
aDrive(2300);
aTurn(-75);
aDrive(900);
driveDistance = -296;
turnPID(true);
turnPID(true);
//main push on right
Wings1.set(true);
Wings2.set(true);
wait(200, msec);
aDriveFor(20, 300);
aDriveFor(50, 200);
aDriveFor(100, 1000);
wait(300, msec);
Wings1.set(false);
Wings2.set(false);
//Line up for second main push (left)
driveDistance = -310;
turnPID(true);
aDrive(-1300);
driveDistance = -390;
turnPID(true);
aDrive(-1600);
driveDistance = -340;
turnPID(true);
turnPID(true);
Wings1.set(true);
Wings2.set(true);
aDriveFor(20, 300);
aDriveFor(50, 200);
aDriveFor(100, 700);
wait(300, msec);
//try and get any more, if possible; back up and spin
aDrive(-1300);
//third go
aDriveFor(20, 300);
aDriveFor(50, 200);
aDriveFor(100, 500);
wait(300, msec);
}
printController(Brain.Timer.value() - timerValue);//print time it took
auton = false;
}
int autonomousProgram() {
autonomousProgramTask();
return 0;
}
void autonomousProgramWrapper(void) {
autonTask = task(autonomousProgram);
}
void buttonBPressed() {
//prints out a bunch of useful information on the brain screen--a status check
Brain.Screen.clearScreen();
Brain.Screen.setCursor(1, 1);
Brain.Screen.print("Battery voltage: ");
Brain.Screen.print(Brain.Battery.voltage());
Brain.Screen.newLine();