Motor Joystick Programming

Hi, I am having issues programming my lift motors using joystick controls. I am using vex 4.3. The motors run fine, as they raise up, but when they lower they do not run at the same speed as racing, and do not run continuously. Most of the time they rotate in the proper direction but in little jerks.
Here is my code:
#pragma config(Motor, port2, leftdrive, tmotorVex393_MC29, openLoop, driveLeft)
#pragma config(Motor, port3, rightdrive, tmotorVex393_MC29, openLoop, driveLeft)
#pragma config(Motor, port4, leftarm, tmotorVex393_MC29, openLoop, driveRight)
#pragma config(Motor, port5, rightarm, tmotorVex393_MC29, openLoop, driveRight)
#pragma config(Motor, port6, intakeleft, tmotorVex393_MC29, openLoop, driveLeft)
#pragma config(Motor, port7, intakeright, tmotorVex393_MC29, openLoop, driveRight)
motor[port2] = -vexRT(Ch3);
motor[port3] = vexRT(Ch2);
motor[port4]=vexRT[Ch5];// set the motor, ‘arm motorleft’ to the left-hand rear buttons.
if(vexRT[Btn5U] == 1) // if Btn5U is pressed:
if(vexRT[Btn5D] == 1) // if Btn5D is pressed:
motor[port5]=vexRT[Ch6];// set the motor, ‘arm motorright’ to the right-hand rear buttons.
if(vexRT[Btn6U] == 1) // if Btn6U is pressed:
if(vexRT[Btn6D] == 1) // if Btn6D is pressed:
if(vexRT[Btn8U] == 1) // if Btn7D is pressed:
if(vexRT[Btn8D] == 1) // if Btn8D is pressed:
Team 184

There are two main problems I can see with the code; there is no task main or while loop (which I’m guessing is a copy-and-paste error), and you have two buttons controlling the same motor using if/else statements.

The first error can be resolved by making sure you have task main() defined at the start of your program, and by putting all of your remote control inside of a while() loop (inside of task main). From the formatting of the code and the extra closing braces that are present, this looks to be like a simple copy/paste error in this case.

The second error is caused by one button turning a motor on, and the other button immediately turning the motor back off. This issue is fairly common, and you can find a deeper explanation (as well as a resolution) in this ROBOTC forum post on the subject.