EV3 rotate function help

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

lej01
New User
Posts: 1
Joined: Sun Oct 15, 2017 3:58 pm

EV3 rotate function help

Postby lej01 » Sun Oct 15, 2017 4:13 pm

I was messing around with an EV3 medium regulated motor and i found out an unexpected behaviour with this two instructions:

Code: Select all

Motor.A.rotate(720,true);
while (Motor.A.isMoving());


the API states that if the boolean parameter of rotate function is true it will not wait for the move to complete. I understand that when the method isMoving is called the motor is still moving(inertia) from the previous method(rotate). My doubt is that i dont understand why the motor rotates 720 degrees even after the rotate function has already been executed, supposedly the motor should stop.

User avatar
gloomyandy
leJOS Team Member
Posts: 5899
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: EV3 rotate function help

Postby gloomyandy » Sun Oct 15, 2017 8:00 pm

I'm not sure exactly what it is you are asking. What did you expect would happen?

You have told it to rotate 720 degrees so that is what it will do, the isMoving call will tell you when the move is complete. The only difference is if the call waits for the operation to complete or not.

Oh and it is not a good idea to use Motor.A with the EV3 instead create instances of the classes you want to use. In this case you need to create and instance of EV3MediuamRegulatedMotor. This class has different motor control parameters compared to those used for a Large motor (which is what you get if you use Motor.A etc.).
leJOS news https://lejosnews.wordpress.com/


Return to “EV3 Software”

Who is online

Users browsing this forum: No registered users and 1 guest