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', # }