Advertisement
Guest User

Untitled

a guest
Aug 27th, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import sys
  2. import select
  3. import os
  4. import time
  5. import RPi.GPIO as GPIO
  6.  
  7. GPIO.setmode(GPIO.BOARD)
  8. GPIO.setup(3, GPIO.OUT)
  9.  
  10. i = 0
  11. while True:
  12. os.system('cls' if os.name == 'nt' else 'clear')
  13. print "I'm doing stuff. Press Enter to stop me!"
  14. print i
  15. GPIO.output(3, GPIO.HIGH)
  16. time.sleep(1)
  17. GPIO.output(3, GPIO.LOW)
  18. time.sleep(1)
  19. GPIO.output(3, GPIO.HIGH)
  20. time.sleep(1)
  21. GPIO.output(3, GPIO.LOW)
  22. time.sleep(1)
  23. if sys.stdin in select.select([sys.stdin], [], [], 0)[0]:
  24. line = raw_input()
  25. break
  26. i += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement