Getting an Arduino to 'sync' to a signal