Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def setStep(w1, w2, w3, w4):
- GPIO.output(coil_A_1_pin, w1)
- GPIO.output(coil_A_2_pin, w2)
- GPIO.output(coil_B_1_pin, w3)
- GPIO.output(coil_B_2_pin, w4)
- GPIO.output(coil_C_1_pin, w1)
- GPIO.output(coil_C_2_pin, w2)
- GPIO.output(coil_D_1_pin, w3)
- GPIO.output(coil_D_2_pin, w4)
- def forward x(delay, steps):
- for i in range(steps):
- for j in range(StepCount):
- setStep(Seq[j][0], Seq[j][1], Seq[j][2], Seq[j][3])
- time.sleep(delay)
- def backwards x(delay, steps):
- for i in range(steps):
- for j in reversed(range(StepCount)):
- setStep(Seq[j][0], Seq[j][1], Seq[j][2], Seq[j][3])
- time.sleep(delay)
- def forward y(delay, steps):
- for i in range(steps):
- for j in range(StepCount):
- setStep(Seq[j][0], Seq[j][1], Seq[j][2], Seq[j][3])
- time.sleep(delay)
- def backwards y(delay, steps):
- for i in range(steps):
- for j in reversed(range(StepCount)):
- setStep(Seq[j][0], Seq[j][1], Seq[j][2], Seq[j][3])
- time.sleep(delay)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement