Here’s the relevant code. It doesn’t stop driving forward, like it doesn’t even register the condition. We’re using a Quadrature encoder. It’s driving us a little crazy.
task autonomous() {
motor[port2] = 127; // this section just raises our lift up
motor[port3] = 127;
motor[port10] = 127;
wait1Msec(1100);
motor[port2] = 0;
motor[port3] = 0;
motor[port10] = 0;
motor[port8] = -127;
wait1Msec(1500);
motor[port8] = 0;
SensorValue[rightEncoder] = 0;
while(SensorValue[rightEncoder] < 720) {
motor[port4] = 127; // our four driving motors - just want to drive forward a bit
motor[port5] = 127;
motor[port6] = 127;
motor[port7] = 127;
}
}