DEV Community

Ashen Chathuranga
Ashen Chathuranga

Posted on • Edited on

2

MorseEncoder: Arduino Library for Encoding Data to Morse Code (Audio & Light)

Hi, My name is Ashen a software developer. I am always passionate about cryptography algorithms and microcontrollers. so I made something that combines two.
its a Library for Arduino called MorseEncoder and what it do is when you pass data to it its going to convert it to Morse code and broadcast it.
it supports various data types to Morse codes, including integers, longs, characters, character arrays, and strings.
its very well documented including installation guides in the repo and a example will look like this,

#include "MorseEncoder.h"

MorseEncoder morseA(9);       // Initialize with the desired pin for Audio **PWM pins only
MorseEncoder morseL(13);      // Initialize with the desired pin for Light

void setup() {
  morseA.beginAudio(15, 500); // [AUDIO] Initialize WPM (word per minute) rate and frequency
  morseL.beginLight(15);      // [LIGHT] Initialize WPM (word per minute) rate
}

void loop() {
  String message = "sos";
  morseA.print(message);   // [AUDIO] Boradcast encoded audio
  delay(2000);
  morseL.print(message);   // [LIGHT] Broadcast encoded light
  delay(2000);
}
Enter fullscreen mode Exit fullscreen mode

in that example I used both features and so you can easily understand how the library works.


Here is a little YouTube short video that ive made with my library, if you know what that Morse code says, comment down bellow 😉

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up