Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. import RPi.GPIO as GPIO
  2. GPIO.setmode(GPIO.BCM)
  3.  
  4. ADDRESS_PINS = [
  5. 4, 17, 27, 22, 10, 9, 11, 5, 6, 13, 19, 26, 21, 20, 16, 12,
  6. ]
  7.  
  8.  
  9. for pin in ADDRESS_PINS:
  10. GPIO.setup(pin, GPIO.IN)
  11.  
  12.  
  13. while True:
  14. result = ""
  15.  
  16. for i in range(0, 16):
  17. if GPIO.input(i):
  18. result += "1"
  19. else:
  20. result += "0"
  21.  
  22. print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement