Advertisement
aravindnatch

Untitled

Dec 9th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. import RPi.GPIO as GPIO
  2. import time
  3.  
  4. GPIO.setmode(GPIO.BCM)
  5.  
  6. GPIO.setup(26, GPIO.IN, pull_up_down=GPIO.PUD_UP)
  7.  
  8. while True:
  9. input_state = GPIO.input(26)
  10. if input_state == False:
  11. print('Button Pressed')
  12. time.sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement