Personally I would use the gpiozero library and the button hold_time parameter:
https://gpiozero.readthedocs.io/en/stab ... tml#button
Code:
from gpiozero import Buttonfrom signal import pausedef say_hello(): print("Hello!")button = Button(26,hold_time=1)button.when_held = say_hellopause()
Statistics: Posted by rpiMike — Tue Jun 25, 2024 9:02 am