Synchronization of light source or manipulator and detector