Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   How to do two actions on the same time? (http://www.chiefdelphi.com/forums/showthread.php?t=144150)

gofmannir 02-19-2016 02:38 PM

How to do two actions on the same time?
 
Hello :)
How I can program that two motors (for example) move at the same time...
In the autonomous I'm using the set() method and after that the delay() and that again set() to stop the motor..
How can I move two motors on the same time?

mikets 02-19-2016 04:54 PM

Re: How to do two actions on the same time?
 
If I understand you correctly, you have something like:
Code:

motor1.set(1.0);
wait(3.0);
motor1.set(0.0);

To control two motors at the same time, you can just do:
Code:

motor1.set(1.0);
motor2.set(1.0);
wait(3.0);
motor1.set(0.0);
motor2.set(0.0);



All times are GMT -5. The time now is 08:59 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi