main.cpp
/*---------------------------------------------------------------------------*/
/*                                                                           */
/*                              Autonomous Task                              */
/*                                                                           */
/*  This task is used to control your robot during the autonomous phase of   */
/*  a VEX Competition.                                                       */
/*                                                                           */
/*  You must modify the code to add your own robot specific commands here.   */
/*---------------------------------------------------------------------------*/
Autonomous Task

This task is used to control your robot during the autonomous phase of
a VEX Competition.

You must modify the code to add your own robot specific commands here.
Autonomous Task This task is used to control your robot during the autonomous phase of a VEX Competition . You must modify the code to add your own robot specific commands here .
void autonomous( void ) {
    autonSetMotorVelocity_func();
    Brain.Screen.print("AutonR1 SHORT--SHOOT & PARK HAS STARTED");
    FLmotor.startRotateFor(4.2,rotationUnits::rev);
    BLmotor.startRotateFor(4.2,rotationUnits::rev);
    FRmotor.startRotateFor(-4.2,rotationUnits::rev);
    BRmotor.startRotateFor(-4.2,rotationUnits::rev);
    while(FLmotor.isSpinning()||BLmotor.isSpinning()||FRmotor.isSpinning()||BRmotor.isSpinning())
    {}
    FLmotor.stop(brakeType::brake);
    BLmotor.stop(brakeType::brake);
    FRmotor.stop(brakeType::brake);
    BRmotor.stop(brakeType::brake);
    vex::task::sleep(1000); 
    FLmotor.startRotateFor(-5.6,rotationUnits::rev);
    BLmotor.startRotateFor(-5.6,rotationUnits::rev);
    FRmotor.startRotateFor(5.6,rotationUnits::rev);
    BRmotor.startRotateFor(5.6,rotationUnits::rev);
    while(FLmotor.isSpinning()||BLmotor.isSpinning()||FRmotor.isSpinning()||BRmotor.isSpinning())
    {}
    FLmotor.stop(brakeType::brake);
    BLmotor.stop(brakeType::brake);
    FRmotor.stop(brakeType::brake);
    BRmotor.stop(brakeType::brake); 
    vex::task::sleep(1000); 
    FLmotor.startRotateFor(-1.5,rotationUnits::rev);
    BLmotor.startRotateFor(-1.5,rotationUnits::rev);
    while(FLmotor.isSpinning()||BLmotor.isSpinning())
    {}
    FLmotor.startRotateFor(-2,rotationUnits::rev);
    BLmotor.startRotateFor(-2,rotationUnits::rev);
    FRmotor.startRotateFor(-2,rotationUnits::rev);
    BLmotor.startRotateFor(-2,rotationUnits::rev);
    while(FLmotor.isSpinning()||BLmotor.isSpinning()||FRmotor.isSpinning()||BRmotor.isSpinning())
    {}
  }
void autonomous ( void ) { autonSetMotorVelocity_func ( ) ; Brain . Screen . print ( " " ) ; FLmotor . startRotateFor ( 4.2 , rotationUnits :: rev ) ; BLmotor . startRotateFor ( 4.2 , rotationUnits :: rev ) ; FRmotor . startRotateFor ( -4.2 , rotationUnits :: rev ) ; BRmotor . startRotateFor ( -4.2 , rotationUnits :: rev ) ; while ( FLmotor . isSpinning ( ) || BLmotor . isSpinning ( ) || FRmotor . isSpinning ( ) || BRmotor . isSpinning ( ) ) { } FLmotor . stop ( brakeType :: brake ) ; BLmotor . stop ( brakeType :: brake ) ; FRmotor . stop ( brakeType :: brake ) ; BRmotor . stop ( brakeType :: brake ) ; vex :: task :: sleep ( 1000 ) ; FLmotor . startRotateFor ( -5.6 , rotationUnits :: rev ) ; BLmotor . startRotateFor ( -5.6 , rotationUnits :: rev ) ; FRmotor . startRotateFor ( 5.6 , rotationUnits :: rev ) ; BRmotor . startRotateFor ( 5.6 , rotationUnits :: rev ) ; while ( FLmotor . isSpinning ( ) || BLmotor . isSpinning ( ) || FRmotor . isSpinning ( ) || BRmotor . isSpinning ( ) ) { } FLmotor . stop ( brakeType :: brake ) ; BLmotor . stop ( brakeType :: brake ) ; FRmotor . stop ( brakeType :: brake ) ; BRmotor . stop ( brakeType :: brake ) ; vex :: task :: sleep ( 1000 ) ; FLmotor . startRotateFor ( -1.5 , rotationUnits :: rev ) ; BLmotor . startRotateFor ( -1.5 , rotationUnits :: rev ) ; while ( FLmotor . isSpinning ( ) || BLmotor . isSpinning ( ) ) { } FLmotor . startRotateFor ( -2 , rotationUnits :: rev ) ; BLmotor . startRotateFor ( -2 , rotationUnits :: rev ) ; FRmotor . startRotateFor ( -2 , rotationUnits :: rev ) ; BLmotor . startRotateFor ( -2 , rotationUnits :: rev ) ; while ( FLmotor . isSpinning ( ) || BLmotor . isSpinning ( ) || FRmotor . isSpinning ( ) || BRmotor . isSpinning ( ) ) { } }
Autonomous Task
Autonomous Task
//---- RED TILE #1: R1 SHORT--SHOOT & PARK //Display that the program has started to the screen //shoot ball  //go forward into flag //back up to gray tile in front of red platform //turn right //go forward up on red platform