New programmer here – using RobotC on a VEX IQ kit. We’re just trying to program the robot to complete a basic (what we thought would be easy) autonomous square. It runs OK, but we experience long pauses / lags before and after the turns. Can someone offer guidance on what we’re doing wrong? TIA
#pragma config(Motor, motor1, left, tmotorVexIQ, PIDControl, encoder)
#pragma config(Motor, motor2, right, tmotorVexIQ, PIDControl, reversed, encoder)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
task main()
{
resetMotorEncoder(left);
resetMotorEncoder(right);
setMotorTarget(left, 1180, 50);
setMotorTarget(right, 1180, 50);
repeatUntil(getMotorEncoder(left) == getMotorTarget(left));
repeatUntil(getMotorEncoder(right) == getMotorTarget(right));
setMotorTarget(left, -500, 50);
setMotorTarget(right, 500, 50);
repeatUntil(getMotorEncoder(left) == getMotorTarget(left));
repeatUntil(getMotorEncoder(right) == getMotorTarget(right));
resetMotorEncoder(left);
resetMotorEncoder(right);
setMotorTarget(left, 1180, 50);
setMotorTarget(right, 1180, 50);
repeatUntil(getMotorEncoder(left) == getMotorTarget(left));
repeatUntil(getMotorEncoder(right) == getMotorTarget(right));
resetMotorEncoder(motor2);
setMotorTarget(motor2, 550, 50);
repeatUntil(getMotorEncoder(motor2) == getMotorTarget(motor2));
resetMotorEncoder(left);
resetMotorEncoder(right);
setMotorTarget(left, 1180, 50);
setMotorTarget(right, 1180, 50);
repeatUntil(getMotorEncoder(left) == getMotorTarget(left));
repeatUntil(getMotorEncoder(right) == getMotorTarget(right));
resetMotorEncoder(motor2);
setMotorTarget(motor2, 500, 50);
repeatUntil(getMotorEncoder(motor2) == getMotorTarget(motor2));
resetMotorEncoder(left);
resetMotorEncoder(right);
setMotorTarget(left, 1180, 50);
setMotorTarget(right, 1180, 50);
repeatUntil(getMotorEncoder(left) == getMotorTarget(left));
repeatUntil(getMotorEncoder(right) == getMotorTarget(right));