Python program with multiple inputs with a timer -
from gpiozero import button, led time import time, sleep random import randint
led = led(17) btn = button(27)
while true:
btn.wait_for_release() start = time() led.on() btn.wait_for_press() end = time() led.off() print(end-start, 'seconds')
how make wait button press , if not pressed within x seconds other function executed. if pressed before x seconds function executed.
Comments
Post a Comment