Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import RPi.GPIO as GPIO
- import time
- GPIO.setmode(GPIO.BCM)
- GPIO.setup(26, GPIO.IN, pull_up_down=GPIO.PUD_UP)
- while True:
- input_state = GPIO.input(26)
- if input_state == False:
- print('Button Pressed')
- time.sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement