How do I make a motor move in a certain amount of rotations?

I know how to make a motor move forever, but I don’t know how to control the number of revolutions.

I know that it’s something like this:
LeftMotor.startRotateFor(x, y);

I don’t know what to put for x and y.

Can someone please explain this to me?

Thanks.

x is an amount of units, y is the units. so (90, degrees) would be an option.

If you right click on startRotateFor in your code and go to definition, you will see the parameter options with comments.

You can similarly go to definition on the word motor in your code and to see all of the methods you can apply to your motor objects (there are a bunch).

1 Like