Skip to content

Instantly share code, notes, and snippets.

@jemerick
Created October 24, 2016 19:34
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 jemerick/e35b9d56648280474ebea3c93859693d to your computer and use it in GitHub Desktop.
Save jemerick/e35b9d56648280474ebea3c93859693d to your computer and use it in GitHub Desktop.
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(16, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
input_state = GPIO.input(16)
if input_state == False:
print('Button Pressed')
time.sleep(0.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment