Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7503

Python • Re: Failed To Add Edge Detection, GPIOZERO

$
0
0
here is my code:
Image
and here is my physical setup(Pins 3.3v, GPIO4, GND):
Image
Image
Image
Image
Image


My full error is :

Code:

Traceback (most recent call last):  File "/home/procidic/LightSensor.py", line 2, in <module>    ldr = LightSensor(4)  File "/home/procidic/.local/lib/python3.9/site-packages/gpiozero/devices.py", line 108, in __call__    self = super(GPIOMeta, cls).__call__(*args, **kwargs)  File "/home/procidic/.local/lib/python3.9/site-packages/gpiozero/input_devices.py", line 679, in __init__    self.pin.when_changed = self._cap_charged  File "/home/procidic/.local/lib/python3.9/site-packages/gpiozero/pins/__init__.py", line 432, in <lambda>    lambda self, value: self._set_when_changed(value),  File "/home/procidic/.local/lib/python3.9/site-packages/gpiozero/pins/pi.py", line 319, in _set_when_changed    self._enable_event_detect()  File "/home/procidic/.local/lib/python3.9/site-packages/gpiozero/pins/rpigpio.py", line 226, in _enable_event_detect    GPIO.add_event_detect(RuntimeError: Failed to add edge detection
This happens with GPIO #4 and GPIO 14 as of now with my Raspberry Pi 4B

Statistics: Posted by Procid — Tue Jul 29, 2025 9:00 pm



Viewing all articles
Browse latest Browse all 7503

Trending Articles