I am new to Python, used my Python common sense but did not get any results. I am trying to learn how to do x-times of button presses and in x-amount of time to trigger something. In the below code, I am trying to do double press in 600ms or less to say "Button pressed twice". The end result I am trying to achieve is, press button once and get "Hello!" and press button twice in less than 600ms and get "Button pressed twice". Sorry for repeating.
from gpiozero import Button from signal import pause def say_hello(): print("Hello!") button = Button(3) button.when_pressed = say_hello pause()