You'll need to measure lightness in the preview, perhaps in the whole image or a specific region. Possibly you'll need some kind of calibration to know what is a 1 and a 0
Such detection can be done with opencv, which is overkill but will work, or subsampling the preview, whatever you prefer
Then you'll need a morse software "decoder" based on the light and timing detected