This repository has been archived on 2026-10-25. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
RIP/gpioTest.py
2026-05-15 16:37:09 +02:00

19 lines
342 B
Python

#!/usr/bin/env python3
import RPi.GPIO as GPIO
import time
def click(self):
print('event detected')
in_pin = 4
GPIO.setmode(GPIO.BCM)
GPIO.setup(in_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.add_event_detect(in_pin, GPIO.FALLING, callback=click,
bouncetime=100)
while True:
time.sleep(0.2)