As part of my quest to replace the potentially dangerous electronics in a recently acquired fan speed controller, the first step is for the Arduino to know exactly when the mains AC waveform is at the ...