from machine import Pin
import time
def handler(pin):
print ("¡Botón detectado")
boton=Pin(25,Pin.IN,Pin.PULL_UP)
boton.irq(trigger=Pin.IRQ_FALLING, handler=handler)
while True:
time.sleep(1)
print ("Esperando...")
time.sleep(5)
while True:
if boton_presionado(boton):
print("Botón detectado")