Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import RPi.GPIO as GPIO
- GPIO.setmode(GPIO.BCM)
- ADDRESS_PINS = [
- 4, 17, 27, 22, 10, 9, 11, 5, 6, 13, 19, 26, 21, 20, 16, 12,
- ]
- for pin in ADDRESS_PINS:
- GPIO.setup(pin, GPIO.IN)
- while True:
- result = ""
- for i in range(0, 16):
- if GPIO.input(i):
- result += "1"
- else:
- result += "0"
- print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement