Skip to content

Instantly share code, notes, and snippets.

@jamesshannon
Last active February 24, 2018 08:26
Show Gist options
  • Select an option

  • Save jamesshannon/88826bab6c668b6c6b89cfb674f6ab9e to your computer and use it in GitHub Desktop.

Select an option

Save jamesshannon/88826bab6c668b6c6b89cfb674f6ab9e to your computer and use it in GitHub Desktop.

Revisions

  1. jamesshannon revised this gist Feb 24, 2018. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion pintest.py
    Original file line number Diff line number Diff line change
    @@ -21,4 +21,14 @@
    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',
    # }
  2. jamesshannon created this gist Feb 24, 2018.
    24 changes: 24 additions & 0 deletions pintest.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    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
    #