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(24, GPIO.IN, pull_up_down=GPIO.PUD_UP)
- GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP)
- while True:
- if (GPIO.input(24) == False):
- print('Button Pressed')
- time.sleep(0.2)
- elif (GPIO.input(20) == False):
- print('Button 2 Pressed')
- time.sleep(0.2)
RAW Paste Data