can someone help me. when i use the highlighted code it makes the motor jerk in only one direction.when i turn it counter clockwise it jerks
Program flow logic is wrong. You have 2 branches where motor[port6] = 0 and a fight going on between setting the motor to -127 and 0. If 6U is not pressed then you set the motor to 0 but then if 6D is pressed you also set it to -127. And the other way around too of course. See code below
if (vexRT[Btn6U] == 1)
{
motor[port6] = 127;
}
else if (vexRT[Btn6D] == 1)
{
motor[port6] = -127;
}
else
{
motor[port6] = 0;
}
You code is telling the motor to be on and off at the same time. If btn 6u is not pressed (=0), you are commanding the motor to zero. In the next if statement, you are telling it to power on if btn 6d is on.
7682 beat me to it. This is a real common mistake.
thanks m8