Autonomous and user controlled issue

I’m trying to have my robot user controlled, but if you press a button I want it to also be able to do it autonomously. I don’t know if this correct can you please look at it.

#pragma config(Motor,  port1,           leftMotor,     tmotorVex393_HBridge, openLoop, reversed)
#pragma config(Motor,  port2,           rightMotor,    tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port3,           servo1,        tmotorServoStandard, openLoop)
#pragma config(Motor,  port4,           servo2,        tmotorServoStandard, openLoop)
#pragma config(Motor,  port5,           servo3,        tmotorServoStandard, openLoop)
#pragma config(Motor,  port6,           servo4,        tmotorServoStandard, openLoop)
#pragma config(Motor,  port7,           smallMotor1,   tmotorVex269_MC29, openLoop)
#pragma config(Motor,  port8,           smallMotor2,   tmotorVex269_MC29, openLoop)

task main()
{
	while(1 == 1)
	{
		motor[leftMotor] = vexRT[Ch3];
		motor[rightMotor] = vexRT[Ch2];

		//Servo Motors
		if(vexRT[Btn5U] == 1)
		{
			motor[servo1] = 80;
		}
		else
		{
			wait(3);
			setServo(servo1, -80);
		}


		if(vexRT[Btn5D] == 1)
		{
			motor[servo2] = 80;
		}
		else
		{
			wait(3);
			setServo(servo2, -80);

		}


		if(vexRT[Btn6U] == 1)
		{
			motor[servo3] = 80;
		}
		else
		{
			wait(3);
			setServo(servo3, -80);
		}

		if(vexRT[Btn6D] == 1)
		{
			motor[servo4] = 80;
		}
		else
		{
			wait(3);
			setServo(servo4, -80);
		}

		//Small Motors
		if(vexRT[Btn7U] == 1)
		{
			motor[smallMotor1] = 80;
		}
		else if(vexRT[Btn7D] == 1)
		{
			motor[smallMotor1] = -80;
		}
		else
		{
			motor[smallMotor1] = 0;
		}

		if(vexRT[Btn7R] == 1)
		{
			motor[smallMotor2] = 80;
		}
		else if(vexRT[Btn7L] == 1)
		{
			motor[smallMotor2] = -80;
		}
		else
		{
			motor[smallMotor2] = 0;
		}

		if(vexRT[Btn8D] == 1)
		{
			break;
			startMotor(rightMotor, 127);
			startMotor(leftMotor, 127);
			startMotor(smallMotor1, -80);
			startMotor(smallMotor2, -80);			
			wait(5);
			stopMotor(rightMotor);
			stopMotor(smallMotor1);
			stopMotor(smallMotor2);
		}
	}
}

Welcome to VEX Forum!
I am not sure what you use an old program(Robot C) or Pro VEXcode. I noticed it is the Robot C program.

You need to add the controller. That can make the buttons autonomously.

1 Like

Are you trying to press a button to start your autonomous routine in user control?

1 Like

I’m trying to make it so its user controlled, but if you press the button it will do something autonomously. So, yes I’m trying to press a button to start my autonomous routine in user control.