We are having trouble getting our motors to go forward for 10 ticks of our encoders; this is how we are testing out encoder code to make sure it works.
MyRobot.cpp (Simple Template)
Our Declaration
Encoder encoderR;
Encoder encoderL;
double dblRight;
Our Init
encoderR(13,12),
encoderL(10,11)
Our Autonomous drive code
encoderR.Start();
encoderL.Start();
dblRight=encoderR.GetDistance();
if(dblRight>-10)
{
myRobot.Drive(0.5, 0.0);
dblRight=encoderR.GetDistance();
}
else if(dblRight<=-10)
{
myRobot.Drive(0.0, 0.0);
dblRight=encoderR.GetDistance();
}