Guest User

Untitled

a guest
Dec 14th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import RPi.GPIO as GPIO
  2. import time
  3.  
  4. GPIO.setmode(GPIO.BCM)
  5. GPIO.setup(17, GPIO.OUT)
  6.  
  7. try:
  8. print('1: ')
  9.  
  10. time.sleep(2)
  11. GPIO.output(17, False)
  12. print(GPIO.input(17))
  13.  
  14. print('2: ')
  15.  
  16. time.sleep(2)
  17. GPIO.output(17, True)
  18. print(GPIO.input(17))
  19.  
  20. print('3: ')
  21.  
  22. time.sleep(2)
  23. GPIO.output(17, False)
  24. print(GPIO.input(17))
  25.  
  26. print('4: ')
  27.  
  28. finally:
  29. GPIO.cleanup()
  30.  
  31. 1:
  32. 0
  33. 2:
  34. 1
  35. 3:
  36. 0
  37. 4:
Add Comment
Please, Sign In to add comment