Any Sample Python Code For Bipoloar Stepper? - Raspberry Pi Forums
i have been searching forever.
bought sainsmart st330 use motor driver board, along rpib+. controlling nema 17 bipolar 4 wire motor.
datasheet: http://www.sainsmart.com/zen/documents/ ... manual.pdf
have found many examples of python programs people using unipolar, 4 gpio pin based code, nothing 2 pin (step,dir) based stepper motor.
not looking alot of functionality test see going on , works.
much!
bought sainsmart st330 use motor driver board, along rpib+. controlling nema 17 bipolar 4 wire motor.
datasheet: http://www.sainsmart.com/zen/documents/ ... manual.pdf
have found many examples of python programs people using unipolar, 4 gpio pin based code, nothing 2 pin (step,dir) based stepper motor.
not looking alot of functionality test see going on , works.
much!
after research have come this, maybe can tell if i'm on right track. code i'm hoping 9 steps in 1 direction wait time in between each step.
code: select all
#!/usr/bin/python # import required libraries import sys import time import rpi.gpio gpio # use bcm gpio references # instead of physical pin numbers gpio.setmode(gpio.bcm) #step pin gpio.setup(17,gpio.out) gpio.output(17, false) #dir pin gpio.setup(22,gpio.out) gpio.output(22, false) waittime = 1 count = 0 while (count < 9): # make 1 step gpio.output(17, false) time.sleep(waittime) gpio.output(22, false) gpio.output(17, true) time.sleep(waittime) count = count +1 print 'one step done , count is:', count print "good bye!"
raspberrypi
Comments
Post a Comment