Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import time
  2. import RPi.GPIO as GPIO
  3. GPIO.setmode(GPIO.BOARD)
  4. GPIO.setwarnings(False)
  5. GPIO.setup(16,GPIO.OUT)
  6. GPIO.setup(18,GPIO.OUT)
  7. GPIO.setup(22,GPIO.OUT)
  8. print('Starting motor sequence!')
  9. while True:
  10. try:
  11. GPIO.output(16, True)
  12. GPIO.output(18, False)
  13. GPIO.output(22, True)
  14. time.sleep(3)
  15.  
  16. GPIO.output(16, False)
  17. GPIO.output(18, True)
  18. GPIO.output(22, True)
  19. time.sleep(3)
  20. except(KeyboardInterrupt):
  21. print('Finishing up!')
  22. GPIO.output(16, False)
  23. GPIO.output(18, False)
  24. GPIO.output(22, False)
  25. quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement