Stepper Motor Control with Me Shiel for Raspberry Pi


Hey dr-roboto !

Sorry I had no time to answer before.

I don’t have the DC motors with me as I’ve lent them to a friend.
Also, I have separate power to my Orion and my rpi but my motors are using the same power as the Orion, maybe it’s not enough ?


According to the specs, this is a 12V motor and 1.7A

Even with a dedicated 12V power supply, not much else will run on the orion if you have two of these motors running.


My power supplies 12VDC and 2.3Amp so that should be ok right ?


When I look at the github code, this is the latest one
it uses slot 1 for the stepper motor (sorry indenting is lost)
from megapi import *

def onForwardFinish(slot):

def onBackwardFinish(slot):

if name == ‘main’:
bot = MegaPi()
while 1:


Yes, this is the one I used to test my motors but actually it’s not working. Maybe the load on the motors can have an impact but they should still try to run no ?



  • interface between orion and rpi work with both shield and usb cable as per ultrasonic test
  • if rpi is powered up on its on external power and the orion is powered up on its own external power and then the rj25 or usb cables are connecte, there should be no loss of power on each
  • your first message has you using stepperMotorRun which was last updated 3 years ago
  • my last msg has me using stepperMotorRun which was updated 2 years ago to “fix the bugs to support python3”

here is the actual github code
def stepperMotorRun(self,slot,speed):
deviceId = 76;

def stepperMotorMove(self,port,speed,distance,callback):
    deviceId = 76;
    extId = ((port<<4)+deviceId)&0xff

def stepperMotorMoveTo(self,port,speed,distance,callback):
    deviceId = 76;
    extId = ((port<<4)+deviceId)&0xff

next steps

  • get the DC motors back from your friend
  • I have run out of ideas, maybe tech support has some ideas


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.