UNOFFICIAL: + drive problems code

Here’s the original link: https://vexforum.com/t/gsmst-qualifier-videos/17967/1

For future reference @The_Baking_Robots anything posted in a subforum with “official” in its name will restrict replies, so no one in the community can answer.

As for the code, you’re close, just some syntax errors.


if (vexRT(Ch1) < 20 && vexRT(Ch1 > -20) {
backdrive = vexRT(Ch3);
fordrive = vexRT(Ch3);
leftdrive = vexRT(Ch4);
rightdrive = vexRT(Ch4);
}
else if(vexRT(Ch1)<-20) {
backdrive = vexRT(Ch1);
fordrive = vexRT(Ch1);
leftdrive = vexRT(Ch1);
rightdrive = vexRT(Ch1);
}
else{
backdrive = vexRT(Ch1);
fordrive = vexRT(Ch1);
leftdrive = vexRT(Ch1);
rightdrive = vexRT(Ch1);
}

In your first condition, you had
if(vexRT(Ch1) < 20 && > -20)
but for robotC, you have to restate the first comparison.

In your final conditional you have a semicolon after the condition, which is wrong syntax. This also doesn’t need to be an else if, since there are no other options. An else statement is enough.

edit:

lol did not see this response earlier. https://vexforum.com/t/unnoficial-response-drive-problems-code/37367/1