Autonomous but with rotations

So I’m trying to make a void as in “void () { motors }” but I want to do it with rotations, I know the command but I want to be able to put in the void that it will turn for literally x rotations so when I put it in the main program I can put the same void as whatever rotations I want.

Can you explain your goal in plain english? I think you want to make a program to turn the bot, but im not 100% sure.

Bruh, I want to make a void with rotations instead of time but the biggest problem is that I don’t want to put a specific rotation, I want it to be able to be flexible as in I can put whatever rotations I want in the main program

Does this mean you want to make a function to drive the robot forward a specific number of motor rotations that you pass as a parameter?

1 Like

yes I do (this is for the minimum characters btw)

The function will probably look something like this:

void moveForRotations(rotationDegrees){
    Motor.rotateFor(rotationDegrees, rotationUnits::deg);
}
2 Likes