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

Python • Re: RuntimeError: Failed to add edge detection after upgrade to Raspberry Pi 4

$
0
0
The edge detection problem is because the GPIO sysfs interface has been removed from recent kernels, and many libraries used that for edge detection.
The question still remains though, what is the gpiozero equivalent to:

Code:

GPIO.add_event_detect(10,GPIO.FALLING, calback=fallingpulseLED, bouncetime = 100)GPIO.add_event_detect(14,GPIO.FALLING, calback=fallingpulseLED, bouncetime = 100)
I sacrificed more trees to purchase the 'Simple Electronics with GPIOZERO' a while ago without realising the significance but there is no mention in there of detecting events, unless it is known as something completely different.
Stop killing trees and try reading the docs, code and examples in the source tree - it is free, less dated and more likely to be correct. It is the definitive reference.

e.g. button_4.py is one example that uses event handlers.

Buttons can also support debounce periods by defining a bounce_time when you create the button.

Statistics: Posted by warthog618 — Mon Jun 03, 2024 1:08 am



Viewing all articles
Browse latest Browse all 5251

Trending Articles