Info

This question is closed. Reopen it to edit or answer.

Arduino question: I want 2 stepper motors to run at the same time.

1 view (last 30 days)
Hi, I have 2 arduinos, 2 motor shields, and 2 stepper motors. I want the 2 motors to run simultaneously, when I connect the 2 steppers to one arduino, the motors do not run at the same time. For example, in a for loop like this, motor 1 will run, stop, then moto 2 will run, stop.
for k=1:3;
a.stepperStep(1,'forward','double',200);
a.stepperStep(2,'forward','double',200);
end
The same issue occurs if I have 2 arduinos connected. For example, the for loop would be like this:
for k=1:3;
a.stepperStep(1,'forward','double',200);
b.stepperStep(1,'forward','double',200);
end
with "b." representing a different arduino than the "a."
Is there a way to make the 2 motors run at the same time?
Thank you.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!