Funzione attachInterrupt bloccante.