Log in

View Full Version : How to do two actions on the same time?


gofmannir
19-02-2016, 14:38
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
19-02-2016, 16:54
If I understand you correctly, you have something like:

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

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

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