Skip to content

Instantly share code, notes, and snippets.

@jamesshannon
Last active February 24, 2018 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesshannon/88826bab6c668b6c6b89cfb674f6ab9e to your computer and use it in GitHub Desktop.
Save jamesshannon/88826bab6c668b6c6b89cfb674f6ab9e to your computer and use it in GitHub Desktop.
RPi Pin Test
import RPi.GPIO as GPIO
import time
# Pinout diagram is at https://pinout.xyz/
GPIO.setmode(GPIO.BCM)
#SPI uses BCM 8, 9, 10, 11
#The LCD_Config file initializes 8, 24, 25, 27
pins = (23, 4, 17, 22, 5, 6, 0, 13, 19, 26, 12, 16, 20, 21)
for pin in pins:
GPIO.setup(pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while 1:
for pin in pins:
if not GPIO.input(pin):
print pin
time.sleep(.2)
# The following pins register False on the Waveshare 1.44" LCD
# pins = {
# 5: 'back',
# 26: 'forward',
# 13: 'btn',
# 6: 'up',
# 19: 'down',
# 21: 'key1',
# 20: 'key2',
# 16: 'key3',
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment