Created
August 4, 2018 05:04
-
-
Save edhedges/c55aad14390b5f43337091b1ce4033ef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BOARD) | |
control_pins = [7,11,13,15] | |
for pin in control_pins: | |
GPIO.setup(pin, GPIO.OUT) | |
GPIO.output(pin, 0) | |
halfstep_seq = [ | |
[1,0,0,0], | |
[1,1,0,0], | |
[0,1,0,0], | |
[0,1,1,0], | |
[0,0,1,0], | |
[0,0,1,1], | |
[0,0,0,1], | |
[1,0,0,1] | |
] | |
for i in range(512): | |
for halfstep in range(8): | |
for pin in range(4): | |
GPIO.output(control_pins[pin], halfstep_seq[halfstep][pin]) | |
time.sleep(0.001) | |
GPIO.cleanup() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment