Coding Problem

I have no idea what’s going on, the robot refuses to do anything, no matter what buttons I press on the joystick, etc. I’ve tried resetting and redownloading firmware to both and can’t get anything to work. Help?

#pragma config(Sensor, in1,    alligatorAng,   sensorPotentiometer)
#pragma config(Sensor, in4,    driverICE,      sensorAnalog)
#pragma config(Sensor, in5,    pwrExp,         sensorAnalog)
#pragma config(Sensor, dgtl1,  liftEncodeR,    sensorQuadEncoder)
#pragma config(Sensor, dgtl3,  liftEncodeL,    sensorQuadEncoder)
#pragma config(Sensor, dgtl5,  lQ,             sensorQuadEncoder)
#pragma config(Sensor, dgtl7,  rQ,             sensorQuadEncoder)
#pragma config(Motor,  port2,           Lw,            tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port3,           liftLB,        tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor,  port4,           liftRB,        tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor,  port5,           liftLT,        tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port6,           liftRT,        tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port7,           alligator,     tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port8,           mobile,        tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor,  port9,           Rw,            tmotorVex393_MC29, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

//Feb 17, 2018
//Ports 5,6,7 are POWER EXPANDER
//liftLT goes in Port A
//liftRT goes in Port B
//Alligator goes in Port C


// This code is for the VEX cortex platform
#pragma platform(VEX)
// Select Download method as "competition"
#pragma competitionControl(Competition)
#pragma autonomousDuration(15)
#pragma userControlDuration(120)

//Main competition background code...do not modify!
#include "Vex_Competition_Includes.c"

void pre_auton()
{
	bStopTasksBetweenModes = true;
}

// Resets the Motor Encoders
void resetDriveEncode()
{
	SensorValue[lQ] = 0;
	SensorValue[rQ] = 0;
}

void resetLiftEncode()
{
	SensorValue[liftEncodeL] = 0;
	SensorValue[liftEncodeR] = 0;
}


// DR4B Movement
//Left and Right divided

void DRBLeft (float speed)
{
	motor[liftLB] = speed; //left bottom
	motor[liftLT] = speed; //left top
}

void DRBRight (float speed)
{
	motor[liftRB] = speed; //right bottom
	motor[liftRT] = speed; //right top
}

void  DRB (float speed)
{
	float difference;
	float scaler;
	difference = liftEncodeL - liftEncodeR;
	scaler = speed * 0.01;
	DRBLeft(speed - (difference * scaler));
	DRBRight(speed + (difference * scaler));
	wait1Msec(20);
}

void DRBPID (int DesiredHeight)
{
	float error;
	float kp;
	kp = 1;
	float tolerance;
	tolerance = 10;
	while(liftEncodeL > DesiredHeight + tolerance || liftEncodeL < DesiredHeight + tolerance)
	{
		error = DesiredHeight - liftEncodeL;
		DRB(error*kp);
	}

}
//////////////////////////////////////////////
///AUTONOMOUS/////////////////////////////////
//////////////////////////////////////////////
task autonomous()
{

}

//////////////////////////////////////////////
///USER CONTROL///////////////////////////////
//////////////////////////////////////////////
task usercontrol()
{
	//Basic movement
	motor[Rw] = (vexRT[Ch2] * 0.75);
	motor[Lw] = (vexRT[Ch3] * 0.75);
	//renegaderobotics.org/ternary-operator-robotc/

	//The claw. We named it alligator ??
	motor[alligator] = vexRT[Ch2Xmtr2];

	//The arms. They "swing" (see line 62)
	DRB(abs(vexRT[Ch3Xmtr2]) > 10 ? vexRT[Ch3Xmtr2] : 0);

	if (vexRT[Btn6UXmtr2])
	{
		DRB(85);
	}

	else if (vexRT[Btn6DXmtr2])
	{
		DRB(-85);
	}

	else
	{
		DRB(0);
	}

	//Mobile goal lift///////////////////////////
	if (vexRT[Btn6U])
	{
		motor[mobile] = 110;
	}

	else if (vexRT[Btn6D])
	{
		motor[mobile] = -110;
	}

	else
	{
		motor[mobile] = 0;
	}

}

edit: posted wrong code

Also, as a note, some stuff in here is not part of the utilized code such as the “DRBPID” It will be used later on, but for now, I’m trying to get basic driver control working.

You need to wrap your user control code in a while(true){} statement so you keep checking the joystick forever instead of checking one time and ending the program.

Yeah, the main loop runs through once and then stops because of how you have it structured right now. You need to use a while(true){} statement to loop the code.