This is no different from optical pulses in optical fiber cable - it's just that now, space is the transmission medium. Just follow the protocol.
From Agrawal, Manish (2010). Business Data Communications. John Wiley & Sons, Inc. p. 54.
- The data is coded as binary numbers at the sender end
- A carrier signal is modulated as specified by the binary representation of the data
- At the receiving end, the incoming signal is demodulated into the respective binary numbers
- Decoding of the binary numbers is performed
...Only to find out that it doesn't work.
See, fiber optic cables have what's called low attenuation, given certain guidelines such as the length of the cable and the bit rate.
In space, you have data loss from things like
- Wave interference
- Gravity - passing celestial body, will bend the light
- Space dust
- The points of failure involving the mechanical energy spent moving your panels
If you want a reliable mode of communication at the speed of light, there's another one: Radio.
It's likely that because radio would be developed long before you have a Dyson Morse Code Sphere, you likely have better error checking technology developed on the receiving end. Longer wavelengths are also better than visible light (shorter than radio) because they don't scatter as easily (See Rayleigh scattering), which would overcome more obstacles you'd find space.