how i could rotate two motor at time

Post your NXJ projects, project ideas, etc here!

Moderators: roger, imaqine, 99jonathan

certikc
New User
Posts: 8
Joined: Tue Mar 17, 2009 8:47 pm
Location: Colombia

how i could rotate two motor at time

Postby certikc » Sat Mar 28, 2009 7:40 pm

hello all, I would like to know how to turn two engines at the same time, I read the topic about this, but I have not found the solution, I read all kind engine far, but I have not found a way. ahh and it wants to control themselves without using the class as well if the pilot is done.
p.d sorry for my bad english

ChrisB01
Advanced Member
Posts: 189
Joined: Sat Mar 15, 2008 12:19 pm
Location: UK

Postby ChrisB01 » Sun Mar 29, 2009 9:26 am

Try having a look at the tutorial. If you want the motors two just both start you could call:

Code: Select all

Motor.A.forward();
Motor.C.forward();

But if you want them to rotate you can call:

Code: Select all

Motor.A.rotate(100,true);
Motor.C.rotate(100,true);

This will have both motors rotate 100 degrees but moth method calls will return immediately.

Chris

certikc
New User
Posts: 8
Joined: Tue Mar 17, 2009 8:47 pm
Location: Colombia

Postby certikc » Tue Mar 31, 2009 9:58 pm

hi, the tutorial page i read it completely, and the motor class`s, and both ways thah you propose to do. but what happens is that you first turn the motor a, and then turn the motor c.

Code: Select all

Motor.A.forward();
Motor.C.forward();


in the other way . the motor a rotates 100 degrees, then the motor c turn 100 degrees c,

Code: Select all

Motor.A.rotate(100,true);
Motor.C.rotate(100,true);

what I want is that both the starting rotation simultaneously, without using the class pilot.
thanks

ChrisB01
Advanced Member
Posts: 189
Joined: Sat Mar 15, 2008 12:19 pm
Location: UK

Postby ChrisB01 » Wed Apr 01, 2009 3:48 pm

This code should start both motors simultaneously, but they will just keep going.

Code: Select all

Motor.A.forward();
Motor.C.forward();


This code should make both motors rotate simultaneously forward 100 degrees and then stop, but both methods will return immediately.

Code: Select all

Motor.A.rotate(100,true);
Motor.C.rotate(100,true);


I think this is what you want to do. If not can you explain your problem in more detail please.

Thanks,

Chris

certikc
New User
Posts: 8
Joined: Tue Mar 17, 2009 8:47 pm
Location: Colombia

Postby certikc » Fri Apr 17, 2009 9:01 pm

ChrisB01 wrote:This code should start both motors simultaneously, but they will just keep going.

Code: Select all

Motor.A.forward();
Motor.C.forward();


This code should make both motors rotate simultaneously forward 100 degrees and then stop, but both methods will return immediately.

Code: Select all

Motor.A.rotate(100,true);
Motor.C.rotate(100,true);


I think this is what you want to do. If not can you explain your problem in more detail please.

Thanks,

Chris

hello, thank you very much, and I managed to do this, for some reason now it´s works.


Return to “NXJ Projects”

Who is online

Users browsing this forum: No registered users and 1 guest

cron