"Generally, an ISR should be as short and fast as possible. If your sketch uses multiple ISRs, only one can run at a time, other interrupts will be executed after the current one finishes in an order that depends on the priority they have. millis() relies on interrupts to count, so it will never increment inside an ISR. Since delay() requires interrupts to work, it will not work if called inside an ISR. micros() works initially but will start behaving erratically after 1-2 ms. delayMicroseconds() does not use any counter, so it will work as normal."
Mi ricordavo di aver letto qualcosa sulle Reference: micros() non si incrementa correttamente dopo 1-2 ma...
Allora: il sensore ad ultrasuoni, dopo aver inviato l'inpulso di Trigger, attende il ritorno del segnale, a quel punto il pin di Echo va ad High, ritorna low appena l'inpulso finisce, quindi potrei usare attachInterrupt CHANGE per determinare inizio e fine e calcolare il tempo trascorso per il calcolo della distanza... dovrebbe funzionare giusto? E a differenza della PulseIn non dovrebbe essere bloccante..