The Raspberry Pi can be a useful communication asset for almost any language or script. If you're not convinced, take a closer look at Reddit user Bamunjal's (opens in new tab)More code Pi project. (opens in new tab) It not only generates code, but also receives and interprets Morse code on the Raspberry Pi.
To create the DIY Morse code communicator, Bamunjal connected a webcam to a Raspberry Pi and used it to monitor an LED. As the LED flashes, the Pi processes the input to translate the flashes into Morse code in real-time.
This project relies on the OpenCV (opens in new tab)programming functions library to handle the real-time image processing. Bamunjal programmed the setup to check for the duration of time the LED is illuminated before verifying the data against a dictionary to determine whether or not the flash was a dot or dash. He uses the same dictionary to generate output for consistency.
If you'd like to explore this project yourself, you can find the full thread here (opens in new tab). Bamunjal even has a video of the project, so you can see it working in real-time. Be sure to follow him on Reddit (opens in new tab) for updates on this Morse code project and any future Raspberry Pi endeavors.