SHARE
TWEET

Untitled

a guest Feb 12th, 2016 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import RPi.GPIO as GPIO
  2. import time
  3.  
  4. GPIO.setmode(GPIO.BCM)
  5. GPIO.setwarnings(False)
  6. coil_A_1_pin = 4 # pink                    #Motor_1
  7. coil_A_2_pin = 17 # orange
  8. coil_B_1_pin = 23 # blau
  9. coil_B_2_pin = 24 # gelb
  10.  
  11. coil_C_1_pin = 18 # pink                 #Motor_2
  12. coil_C_2_pin = 22 # orange            
  13. coil_D_1_pin = 25 # blau
  14. coil_D_2_pin = 27 # gelb
  15.  
  16. # anpassen, falls andere Sequenz
  17. StepCount = 4
  18. Seq = range(0, StepCount)
  19. Seq[0] = [1,0,0,0]
  20. Seq[1] = [0,0,1,0]
  21. Seq[2] = [0,1,0,0]
  22. Seq[3] = [0,0,0,1]
  23.  
  24. GPIO.setup(coil_A_1_pin, GPIO.OUT)         #Motot_1
  25. GPIO.setup(coil_A_2_pin, GPIO.OUT)
  26. GPIO.setup(coil_B_1_pin, GPIO.OUT)
  27. GPIO.setup(coil_B_2_pin, GPIO.OUT)
  28.  
  29. GPIO.setup(coil_C_1_pin, GPIO.OUT)          #Motor_2
  30. GPIO.setup(coil_C_2_pin, GPIO.OUT)
  31. GPIO.setup(coil_D_1_pin, GPIO.OUT)
  32. GPIO.setup(coil_D_2_pin, GPIO.OUT)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top