Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import select
- import os
- import time
- import RPi.GPIO as GPIO
- GPIO.setmode(GPIO.BOARD)
- GPIO.setup(3, GPIO.OUT)
- i = 0
- while True:
- os.system('cls' if os.name == 'nt' else 'clear')
- print "I'm doing stuff. Press Enter to stop me!"
- print i
- GPIO.output(3, GPIO.HIGH)
- time.sleep(1)
- GPIO.output(3, GPIO.LOW)
- time.sleep(1)
- GPIO.output(3, GPIO.HIGH)
- time.sleep(1)
- GPIO.output(3, GPIO.LOW)
- time.sleep(1)
- if sys.stdin in select.select([sys.stdin], [], [], 0)[0]:
- line = raw_input()
- break
- i += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement