My Autonomous doesn't work

So I recently tried to test my autonomous code with my robot and I found that it didn’t do anything. My robot only performed the first two commands and then stopped. If someone could find out what’s wrong, that would be great.

  #include "vex.h"

using namespace vex;

const double pi = atan(1)*4;

int color_value = 0;
int color_value_2 = 0;
int text_value = 1;

// define your global instances of motors and other devices here
  motor LeftDrive ( PORT21, true );
  motor RightDrive ( PORT11);
  motor LeftBarMotor ( PORT20);
  motor RightBarMotor ( PORT14, true);
  motor LeftIntakeMotor ( PORT10 );
  motor RightIntakeMotor ( PORT13 );
  motor StackRelease ( PORT12 );
  vision VisionSensor ( PORT7 );
//radio Communicator        = radio( PORT20 );
  controller MasterController = controller();

// A global instance of competition

competition Competition;

//Autonomous Varibles and Functions
double convert(double inches){
   return (inches*4)/(11*pi);
 };

 void yeet(bool color, bool tile){
StackRelease.rotateTo(100, rotationUnits::deg); 
LeftBarMotor.rotateTo(140, rotationUnits::deg, 100);
RightBarMotor.rotateTo(140, rotationUnits::deg, 100);
RightIntakeMotor.spin(directionType::fwd, 100, velocityUnits::pct);
LeftIntakeMotor.spin(directionType::rev, 100, velocityUnits::pct);
if (color % 2 == 0){
   // red tile 1
 if (tile % 2 == 0){
 //  moves forward 54 inches(can change)
   LeftDrive.rotateTo(convert(54), rotationUnits(rev),100, velocityUnits::pct, false);
   RightDrive.rotateTo(convert(54), rotationUnits(rev),100, velocityUnits::pct, true);
   LeftDrive.stop();
   //turn right 90 degrees
   LeftDrive.rotateTo(-700, rotationUnits(deg),100, velocityUnits::pct, false);
   RightDrive.rotateTo(700, rotationUnits(deg),100, velocityUnits::pct);
   //moves forward 72 inches
   LeftDrive.rotateTo(convert(72), rotationUnits(rev),100, velocityUnits::pct, false);
   RightDrive.rotateTo(convert(72), rotationUnits(rev),100, velocityUnits::pct, true);
   //turns right 90 degrees
   LeftDrive.rotateTo(-700, rotationUnits(deg),100, velocityUnits::pct, false);
   RightDrive.rotateTo(700, rotationUnits(deg),100, velocityUnits::pct);
   //move forward 22 inches
   LeftDrive.rotateTo(convert(22), rotationUnits(rev),100, velocityUnits::pct, false);
   RightDrive.rotateTo(convert(22), rotationUnits(rev),100, velocityUnits::pct, true);
   //turn left 45 degrees
   LeftDrive.rotateTo(-350, rotationUnits(deg),100, velocityUnits::pct, false);
   RightDrive.rotateTo(350, rotationUnits(deg),100, velocityUnits::pct);
   //drive forward 16 inches
LeftDrive.rotateTo(convert(30), rotationUnits(rev),100, velocityUnits::pct, false);
   RightDrive.rotateTo(convert(30), rotationUnits(rev),100, velocityUnits::pct, true);
   RightIntakeMotor.spin(directionType(false));
   LeftIntakeMotor.spin(directionType(true));
   task::sleep(3000);
   RightIntakeMotor.stop();
   LeftIntakeMotor.stop();
 }
 //red tile 2
 else if (tile % 2 == 1){
   //moves forward 54 inches(can change)
   LeftDrive.rotateTo(convert(54), rotationUnits(rev),100, velocityUnits::pct, false);
   RightDrive.rotateTo(convert(54), rotationUnits(rev),100, velocityUnits::pct, true);
   LeftDrive.stop();
   //turn 90 degrees
   LeftDrive.rotateTo(700, rotationUnits(deg),100, velocityUnits::pct, false);
   RightDrive.rotateTo(-700, rotationUnits(deg),100, velocityUnits::pct);
   //moves forward 72 inches
   LeftDrive.rotateTo(convert(72), rotationUnits(rev),100, velocityUnits::pct, false);
   RightDrive.rotateTo(convert(72), rotationUnits(rev),100, velocityUnits::pct, true);
   //turns left 45 degrees
   LeftDrive.rotateTo(360, rotationUnits(deg),100, velocityUnits::pct, false);
   RightDrive.rotateTo(-360, rotationUnits(deg),100, velocityUnits::pct);
   //move forward 24 inches
   LeftDrive.rotateTo(convert(24), rotationUnits(rev),100, velocityUnits::pct, false);
   RightDrive.rotateTo(convert(24), rotationUnits(rev), 100, velocityUnits::pct,true);
   RightIntakeMotor.spin(directionType(false));
   LeftIntakeMotor.spin(directionType(true));
   RightIntakeMotor.stop();
   LeftIntakeMotor.stop();
 }
 
   }
   else if (color % 2 == 1){
 //blue tile 1
 if (tile % 2 == 0){
   //moves forward 54 inches(can change)
   LeftDrive.rotateTo(convert(54), rotationUnits(rev),100, velocityUnits::pct, false);
   RightDrive.rotateTo(convert(54), rotationUnits(rev),100, velocityUnits::pct, true);
   LeftDrive.stop();
   //turn 90 degrees
   LeftDrive.rotateTo(700, rotationUnits(deg),100, velocityUnits::pct, false);
   RightDrive.rotateTo(-700, rotationUnits(deg),100, velocityUnits::pct);
   //moves forward 72 inches
   LeftDrive.rotateTo(convert(72), rotationUnits(rev),100, velocityUnits::pct, false);
   RightDrive.rotateTo(convert(72), rotationUnits(rev),100, velocityUnits::pct, true);
   //turns left 90 degrees
   LeftDrive.rotateTo(700, rotationUnits(deg), 100, velocityUnits::pct,false);
   RightDrive.rotateTo(-700, rotationUnits(deg),100, velocityUnits::pct);
   //move forward 22 inches
   LeftDrive.rotateTo(convert(22), rotationUnits(rev),100, velocityUnits::pct, false);
   RightDrive.rotateTo(convert(22), rotationUnits(rev),100, velocityUnits::pct, true);
   //turn right 45 degrees
   LeftDrive.rotateTo(-350, rotationUnits(deg),100, velocityUnits::pct, false);
   RightDrive.rotateTo(350, rotationUnits(deg),100, velocityUnits::pct);
   //drive forward 16 inches
LeftDrive.rotateTo(convert(30), rotationUnits(rev),100, velocityUnits::pct, false);
   RightDrive.rotateTo(convert(30), rotationUnits(rev), 100, velocityUnits::pct,true);
   RightIntakeMotor.spin(directionType(false));
   LeftIntakeMotor.spin(directionType(true));
   RightIntakeMotor.stop();
   LeftIntakeMotor.stop();
 }
 //blue tile 2 option 1
 else if (tile % 2 == 1){
 
   //moves forward 54 inches(can change)
   LeftDrive.rotateTo(convert(54), rotationUnits(rev),100, velocityUnits::pct, false);
   RightDrive.rotateTo(convert(54), rotationUnits(rev),100, velocityUnits::pct, true);
   LeftDrive.stop();
   //turn 270 degrees
   LeftDrive.rotateTo(700, rotationUnits(deg),100, velocityUnits::pct, false);
   RightDrive.rotateTo(-700, rotationUnits(deg),100, velocityUnits::pct);
   //moves forward 72 inches
   LeftDrive.rotateTo(convert(72), rotationUnits(rev),100, velocityUnits::pct, false);
   RightDrive.rotateTo(convert(72), rotationUnits(rev),100, velocityUnits::pct, true);
   //turns right 45 degrees
   LeftDrive.rotateTo(-360, rotationUnits(deg),100, velocityUnits::pct, false);
   RightDrive.rotateTo(360, rotationUnits(deg),100, velocityUnits::pct);
   //move forward 24 inches
   LeftDrive.rotateTo(convert(24), rotationUnits(rev),100, velocityUnits::pct, false);
   RightDrive.rotateTo(convert(24), rotationUnits(rev),100, velocityUnits::pct, true);
   RightIntakeMotor.spin(directionType(false));
   LeftIntakeMotor.spin(directionType(true));
   RightIntakeMotor.stop();
   LeftIntakeMotor.stop();
 }
   }
 };

The function “yeet” is called in my autonomous like this:

void autonomous( void ) {
  // .........................................................................

   yeet(color_value, text_value);
  // ..........................................................................
}

The yeet function is expecting two bool values (color & title). A bool is either true or false, did you intend to use an integer value (int) instead?

void yeet (int color, int tile) {

If you still use a bool, you may want to try doing this instead:

if(color== true)
{
	if(tile == true)
	{
	  ....
	}
	else {
	  ....
	}
}
else {
	if(tile == true)
	{
	  ....
	}
	else {
	  ....
	}
}
1 Like

Yes. I was intending to use an integer.