So multiple groups in my class are having this same problem. We are simply trying to use our quadrature encoders to drive a set distance then stop and return to the starting point. Sample code looks like this
wait1Msec(1000)
SensorValue[leftEncoder] = 0;
SensorValue[rightEncoder] = 0;
while(SensorValue[leftEncoder] < 360)
{
motor[rightMotor] = 93;
motor[leftMotor] = 93;
}
SensorValue[leftEncoder] = 0;
SensorValue[rightEncoder] = 0;
while(SensorValue[leftEncoder] > -360)
{
motor[rightMotor] = -93;
motor[leftMotor] = -93;
}
When we run the code, the Values in the Debugger window show up correctly and count up correctly but the loop doesn’t stop until almost twice the desired Encoder counts. If the group puts 360 in it won’t stop until like 700 encoder counts. If the group puts 500 in for the value of encoder counts it won’t stop until around 1000 encoder counts. It is almost like RobotC is just ignoring the encoder values until almost twice the value, we run the same code to back up and place the same number in and it will stop at the desired encoder counts. I have updated firmware multiple times, tried different cortexes and encoders all with no improvement.
HELP!!!
OK this is going to sound really stupid but why can I not post a new reply to this thread. I hit the post a reply button and nothing happens? I can edit my original post but not add a new reply???