Skip to content

Instantly share code, notes, and snippets.

@G10DRAS
Created January 7, 2016 10:52
Show Gist options
  • Save G10DRAS/e6083b064d0c7e073205 to your computer and use it in GitHub Desktop.
Save G10DRAS/e6083b064d0c7e073205 to your computer and use it in GitHub Desktop.
import RPi.GPIO as GPIO
import time
button = 20
GPIO.setmode(GPIO.BCM)
GPIO.setup(button, GPIO.IN, pull_up_down=GPIO.PUD_UP)
input_state = GPIO.input(button)
print input_state
GPIO.cleanup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment