VEXRT Help [R]

Hello. Recently, I have been trying to use a VEXRT controller at school to be able to control our robot, but we have been experiencing some problems. After watching a couple videos, I have came up with this code:

task main()
{
while(1==1)
{
	motor[rightMotor] = vexRT[Ch3];
		motor[leftMotor] = vexRT[Ch2];
		
		if(vexRT[Btn6U] == 1)
		{
			motor(rightMotor) = 127;
		}
		
		else if (vexRT[Btn6D] == 1)
		{
			motor(rightMotor) = -127;
		}
		
		else
		{
			motor(rightMotor) = 0;
		}

}

}

. After downloading this code onto my robot, plugging in the USB receiver to the robot, then using the controller, it has not worked. Can somebody please supply me with a code which will work by using the two joysticks (pushing them forwards).

Thanks!

I see that you already had some help from the community. Simple tank control of a robot with one motor on each side would be as follows.

#pragma config(Motor,  port1,           leftMotor,     tmotorVex393_HBridge, openLoop)
#pragma config(Motor,  port10,          rightMotor,    tmotorVex393_HBridge, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
    while(1) {
        // Tank drive
        motor leftMotor ]  = vexRT Ch3 ];
        motor rightMotor ] = vexRT Ch2 ];
        
        wait1Msec(10);
    }
}

Make sure you are downloading for “VEXnet or USB” or “Competition” and not “USB Only” as that option will disable the joystick.