The pin_interrupt.ino file samples a binary input using clock interrupts and input capture.