Unnoficial Response: + drive problems code

When posting code, it’s best to highlight it and then click the “</>” button to show that it’s code.
Okay… So before doing anything else, you should have it be “vexRT[Ch3]” instead of “vexRT(Ch3),” and that should be so forth…
You should have the else if statements be like


else if

instead of


else
if

You also need to define that those names are motors too, so you would do


motor[backdrive]

instead of


backdrive

So here’s what it should be when I fix them(If there are further issues, tell me):


//there is a while true line so it's not that
if (vexRT[Ch1] < 20 && vexRT[Ch1]  > -20)
{
motor[backdrive] = vexRT[Ch3];
motor[fordrive] = vexRT[Ch3];
motor[leftdrive] = vexRT[Ch4];
motor[rightdrive] = vexRT[Ch4];
}
else if(vexRT[Ch1]<-20)
{
motor[backdrive] = vexRT[Ch1];
motor[fordrive] = vexRT[Ch1];
motor[leftdrive] = vexRT[Ch1];
motor[rightdrive] = vexRT[Ch1];
}
else if(vexRT[Ch1]>20);
{
motor[backdrive] = vexRT[Ch1];
motor[fordrive] = vexRT[Ch1];
motor[leftdrive] = vexRT[Ch1];
motor[rightdrive] = vexRT[Ch1];
}

You have a semicolon after that last “else if” statement.

Oops… Let me fix that:


//there is a while true line so it's not that
if (vexRT[Ch1] < 20 && vexRT[Ch1]  > -20)
{
motor[backdrive] = vexRT[Ch3];
motor[fordrive] = vexRT[Ch3];
motor[leftdrive] = vexRT[Ch4];
motor[rightdrive] = vexRT[Ch4];
}
else if(vexRT[Ch1]<-20)
{
motor[backdrive] = vexRT[Ch1];
motor[fordrive] = vexRT[Ch1];
motor[leftdrive] = vexRT[Ch1];
motor[rightdrive] = vexRT[Ch1];
}
else if(vexRT[Ch1]>20)
{
motor[backdrive] = vexRT[Ch1];
motor[fordrive] = vexRT[Ch1];
motor[leftdrive] = vexRT[Ch1];
motor[rightdrive] = vexRT[Ch1];
}

thank you