Skip to content

Instantly share code, notes, and snippets.

@salexkidd
Created November 30, 2015 11:28
Show Gist options
  • Save salexkidd/85639e3bf55b2c891fb9 to your computer and use it in GitHub Desktop.
Save salexkidd/85639e3bf55b2c891fb9 to your computer and use it in GitHub Desktop.
address GPIO pin checks
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment