Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import RPi.GPIO as GPIO
- GPIO.setmode(GPIO.BOARD)
- GPIO.setwarnings(False)
- GPIO.setup(16,GPIO.OUT)
- GPIO.setup(18,GPIO.OUT)
- GPIO.setup(22,GPIO.OUT)
- print('Starting motor sequence!')
- while True:
- try:
- GPIO.output(16, True)
- GPIO.output(18, False)
- GPIO.output(22, True)
- time.sleep(3)
- GPIO.output(16, False)
- GPIO.output(18, True)
- GPIO.output(22, True)
- time.sleep(3)
- except(KeyboardInterrupt):
- print('Finishing up!')
- GPIO.output(16, False)
- GPIO.output(18, False)
- GPIO.output(22, False)
- quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement