Guest User

Untitled

a guest
Aug 18th, 2015
209
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import RPi.GPIO as GPIO
  2. import time
  3.  
  4. GPIO.setmode(GPIO.BCM)
  5.  
  6. GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP)
  7.  
  8. while True:
  9. input_state = GPIO.input(20)
  10. if input_state == False:
  11. print('Button Pressed')
  12. time.sleep(0.2)
RAW Paste Data