I am using a raspberry pi model B to drive one stepper motor with the L293D chip and python. Now I would like to control two stepper motors simultaneously with two different L293D chips and python. I have read that this can be done with python threading but it is very difficult. Is there another way to accomplish that with python? Thank you.

  • 2
    Isn't it still "just" a matter of turning on and off some GPIO pins - only twice the number you're currently toggling? I'm not exactly sure what you want or what the problem is but I wonder if you need threading at all. Seeing some code or the expected output would be helpful.
    – jDo
    Apr 11, 2016 at 13:53

2 Answers 2


As jDo said you can just deal with the situation as another set of GPIO pins.

Here is my blog post where I did just that http://jumpstation.co.uk/flog/Mar2014.html#190320142109

The code simple copies the previous stepper motor code and changes the GPIO pins assignments. You pass in the number of steps you want each motor to do on the command line.


What I would suggest is you use a L298N Motor Controller. You have to have a separate power source for it but you can power and control 2 motors at once using the GPIO pins and python

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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