Im trying to code autonomous but whenever i add the last 5 lines the code doesn’t run how it previously did with the added ending. Im not sure what to do. Here is the code.
#include “robot-config.h”
int main() {
//Shoot Catapult
LeftCatapult.spin(directionType::rev,100,velocityUnits::pct);
RightCatapult.spin(directionType::rev,100,velocityUnits::pct);
task::sleep(1000);
LeftCatapult.stop(brakeType::brake);
RightCatapult.stop(brakeType::brake);
//Turn Bot
LeftMotor.spin(directionType::rev,75,velocityUnits::rpm);
RightMotor.spin(directionType::fwd,75,velocityUnits::rpm);
BackLeftMotor.spin(directionType::rev,75,velocityUnits::rpm);
BackRightMotor.spin(directionType::fwd,75,velocityUnits::rpm);
task::sleep(800);
LeftMotor.stop(brakeType::brake);
RightMotor.stop(brakeType::brake);
BackLeftMotor.stop(brakeType::brake);
BackRightMotor.stop(brakeType::brake);
//Move Bot Forward
LeftMotor.startRotateFor(50,rotationUnits::deg,100,velocityUnits::pct);
RightMotor.startRotateFor(50,rotationUnits::deg,100,velocityUnits::pct);
BackLeftMotor.startRotateFor(50,rotationUnits::deg,100,velocityUnits::pct);
BackRightMotor.startRotateFor(50,rotationUnits::deg,100,velocityUnits::pct);
//Move Bot Backward
LeftMotor.startRotateFor(-1200,rotationUnits::deg,-90,velocityUnits::pct);
RightMotor.startRotateFor(-1200,rotationUnits::deg,-100,velocityUnits::pct);
BackLeftMotor.startRotateFor(-1200,rotationUnits::deg,-90,velocityUnits::pct);
BackRightMotor.startRotateFor(-1200,rotationUnits::deg,-100,velocityUnits::pct);
//Move Bot Forward
LeftMotor.startRotateFor(50,rotationUnits::deg,100,velocityUnits::pct);
RightMotor.startRotateFor(50,rotationUnits::deg,100,velocityUnits::pct);
BackLeftMotor.startRotateFor(50,rotationUnits::deg,100,velocityUnits::pct);
BackRightMotor.startRotateFor(50,rotationUnits::deg,100,velocityUnits::pct);
}