void autonomous(void) {
//RIGHT ROLLER SHOOTING
solenoid.set(true);
int speed2 = 50;
FrontLeftmotor.setVelocity( speed2, vex::percentUnits::pct);
FrontRightmotor.setVelocity( speed2, vex::percentUnits::pct);
BackLeftmotor.setVelocity( speed2, vex::percentUnits::pct);
BackRightmotor.setVelocity( speed2, vex::percentUnits::pct);
elevatorMotor.setVelocity( speed2, vex::percentUnits::pct);
flywheelMotor2.setVelocity( 40, vex::percentUnits::pct);
flywheelMotor1.setVelocity(40, vex::percentUnits::pct);
flywheelMotor1.rotateFor(vex::directionType::fwd,10000, vex::rotationUnits::deg, false);
flywheelMotor2.rotateFor(vex::directionType::fwd,10000, vex::rotationUnits::deg,false);
vex::task::sleep(3000);
solenoid.set(false);
vex::task::sleep(250);
solenoid.set(true);
vex::task::sleep(700);
solenoid.set(false);
vex::task::sleep(250);
solenoid.set(true);
flywheelMotor1.stop(vex::brakeType::coast);
flywheelMotor2.stop(vex::brakeType::coast);
vex::task::sleep(250);
int fwd3 =685;
FrontLeftmotor.rotateFor(vex::directionType::fwd, fwd3, vex::rotationUnits::deg, false);
FrontRightmotor.rotateFor(vex::directionType::fwd, fwd3, vex::rotationUnits::deg, false);
BackLeftmotor.rotateFor(vex::directionType::fwd,fwd3, vex::rotationUnits::deg, false);
BackRightmotor.rotateFor(vex::directionType::fwd,fwd3, vex::rotationUnits::deg);
int TR1 =485;
FrontLeftmotor.rotateFor(vex::directionType::fwd, TR1, vex::rotationUnits::deg, false);
FrontRightmotor.rotateFor(vex::directionType::rev, TR1, vex::rotationUnits::deg, false);
BackLeftmotor.rotateFor(vex::directionType::fwd,TR1, vex::rotationUnits::deg, false);
BackRightmotor.rotateFor(vex::directionType::rev,TR1, vex::rotationUnits::deg);
int speed3 = 25;
FrontLeftmotor.setVelocity( speed3, vex::percentUnits::pct);
FrontRightmotor.setVelocity( speed3, vex::percentUnits::pct);
BackLeftmotor.setVelocity( speed3, vex::percentUnits::pct);
BackRightmotor.setVelocity( speed3, vex::percentUnits::pct);
elevatorMotor.rotateFor(vex::directionType::rev,400, vex::rotationUnits::deg,false);
int forwardd = 1500;
FrontLeftmotor.spin(vex::directionType::fwd);
FrontRightmotor.spin(vex::directionType::fwd);
BackLeftmotor.spin(vex::directionType::fwd);
BackRightmotor.rotateFor(vex::directionType::fwd, forwardd, vex::timeUnits::msec );
vex::task::sleep(100);
int fwd2 =100;
FrontLeftmotor.rotateFor(vex::directionType::rev, fwd2, vex::rotationUnits::deg, false);
FrontRightmotor.rotateFor(vex::directionType::rev, fwd2, vex::rotationUnits::deg, false);
BackLeftmotor.rotateFor(vex::directionType::rev,fwd2, vex::rotationUnits::deg, false);
BackRightmotor.rotateFor(vex::directionType::rev,fwd2, vex::rotationUnits::deg);
}
int main() {
Competition.drivercontrol(usercontrol);
Competition.autonomous(autonomous);
//Prevent main from exiting with an infinite loop.
while(1) {
vex::task::sleep(100);//Sleep the task for a short amount of time to prevent wasted resources.
}
vexcodeInit();
}