Arduino-based-phasemeter Measures the phase between two digital signals. Based on interrupts and the arduino microsecond counter. Description is given in wiki