i’m having trouble getting consistent # of revolutions with our quadrature shaft encoders. At first a value of 360 “ticks” gave us two revolutions. Then when tested again maybe 10 minutes later the gear did not revolve the same number of revolutions and a value of 270 gave the gear one full revolution. Then, once again, when i ran the program again the value gave more than a revolution. basically our shaft encoders seem to be needing different values for one revolution each time we test the program. One value may work for a few trials, but when left alone for a few minutes the value needed to get one revolution changes. So could someone show me exactly what i’m doing wrong with my code?
task main()
{
SensorValue[leftEncoder]=0;
SensorValue[rightEncoder]=0;
while(SensorValue[rightEncoder]>-360)
{
motor[right]=60;
}
while(SensorValue[leftEncoder]<265)
{
motor[left]=-60;
}
}