Created
November 30, 2015 11:28
-
-
Save salexkidd/85639e3bf55b2c891fb9 to your computer and use it in GitHub Desktop.
address GPIO pin checks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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