Synchronizing to an time-varying external pulse

I've written quite a few pulse receiving applications, and I have always evolved to detecting the pulse by interrupt. Just create a simple little Interrupt routine that sets a boolean flag when a pulse arrives, and let your main loop read the flag and initiate whatever action you require. Always best to minimize the time spent in the ISR.

I have found that trying to read a pulse in a loop works fine, until you start adding to the code. Then strange things begin to happen. Interrupts are very easy to use with Arduino, and after all, detecting pulses is what they're for.

Good luck

John Doner