Why is the stepper motor running so slowly(almost did not move)?
Posted: 26 Oct 2018, 04:45
I have a RasPI and a Revpi, Now I want to have a revpi controlled motor, but failed.
My code look like this:
RevPI code is:
Everything is the same except RevPI and Raspberry Pi, Why raspberry pie can drive, but revpi can't?
My code look like this:
Code: Select all
LinearActuatorDir_x =40
LinearActuatorStepPin_x = 38
def Forward_x():
GPIO.output(LinearActuatorDir_x, 0)
GPIO.output(LinearActuatorStepPin_x, 0)
time.sleep(0.0003)
GPIO.output(LinearActuatorStepPin_x, 1)
time.sleep(0.0003)
)
Code: Select all
LinearActuatorDir_x = "I_1"
LinearActuatorStepPin_x = "I_2"
def Forward():
rpi.io["LinearActuatorDir_x "].value = 0
rpi.io["LinearActuatorStepPin_x "].value = 0
time.sleep(0.0003)
rpi.io["LinearActuatorStepPin_x "].value = 1
time.sleep(0.0003)