In my autonomous, I am attempting to use the turnFor command. However, when I run it, the robot just turns infinitely in a circle. However, if I print the drivetrain heading to the screen, it is accurate. Is there something that I am missing? Also, Is there a way to set a deadband on the turning so that it doesn’t have to be exactly precise?
Also, for reference, this is my code:
//Gyroscope-Based Turning Function
void gyroturn (double powerpct, int amount, bool end)
{Drivetrain.turnFor(amount, degrees, (powerpct*2), rpm, true);}