Arduino morse library

July 26th, 2008

So I’m just chuffed I’ve gone from hello world to libraries this morning.   Nothing complicated, but tedious.

A couple of examples:

#include <Morse.h>
Morse morse(13,5); // pin, wpm
void setup() {}

void loop() {
    morse.send("CQ World K");
    delay(5000);
}

And just a tiny bit more involved, serial in, morse out.

#include <Morse.h>
Morse morse(13,30);
char letter;

void setup()
{
  Serial.begin(9600);
}

void loop()
{
    if (Serial.available())
    {
        letter = Serial.read();
        morse.letter(letter);
    }
}

Updated: Dec 2008
Incorporated fixes by Andrew, to make timings more usable for real applications. Thanks Andrew.

Download: libmorse-0.2.zip (16k)