Advertisement
cymplecy

input

Feb 8th, 2016
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. #! /usr/bin/python
  2. import RPi.GPIO as GPIO
  3. GPIO.setmode(GPIO.BOARD) # Means use physical pin numbers
  4. GPIO.setup(11,GPIO.IN,pull_up_down=GPIO.PUD_UP) # set to input with pull-up resistor
  5. while True:
  6.   if (GPIO.input(11) == 0):
  7.     print("Button Pressed")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement