Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #!/usr/bin/env/ python
  2.  
  3. import RPi.GPIO as GPIO
  4. GPIO.setmode (GPIO.BOARD)
  5. GPIO.setup (7, GPIO.OUT)
  6.  
  7. print ("Welcome")
  8.  
  9. while True:
  10. status = raw_input ("Please enter a value: ")
  11. print ("You entered: ",status)
  12.  
  13. if status == "exit":
  14. break;
  15. else if status == "on":
  16. print ("On")
  17. GPIO.output(7, True)
  18. else if status == "off":
  19. print ("Off")
  20. GPIO.output(7, False)
  21. else:
  22. print ("Invalid value, please enter 'on' or 'off', or 'exit' to exit the program")
  23. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement