1
\$\begingroup\$

I have got two stepper motors that I want to drive at the same time using an Arduino. They both work with 2 separate DRV8825 stepper drivers that are connected to the Arduino. I can get them both to work at different times with the code but want to merge the code so that they both do different things at the same time?

Is this possible to do?

\$\endgroup\$

closed as off-topic by Dave Tweed Oct 18 '18 at 12:20

  • This question does not appear to be about electronics design within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

2
\$\begingroup\$

It would help if you added the current source code. Probably you use delays, in that case, use millis() instead and use the same technique as the Blink Without Delay example.

When using delay, it will cause your program to 'halt' not being able to do actions concurrently. With keeping a state (and time since last state change) for both motors you can check for a time to elapse to do the correct actions for one or both motor.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.