Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
A Morse Encoding/Decoding Library \n Transforms char arrays into bool arrays and vice-versa
Morse code taken from http://en.wikipedia.org/wiki/Morse_code
Added some more characters :
- : DOT DOT DASH DASH
_ : DASH DASH DASH DOT
. : DASH DASH DASH DASH
/ : DOT DASH DOT DASH
@ : DOT DOT DOT DASH DOT
? : DOT DOT DASH DOT DOT
Here is an quick hello-world that show how to use this library
#include "mbed.h
#include "Morse.h"
Serial pc(USBTX, USBRX);
int main() {
int i;
Morse_data* data;
char message[] = "Hello World";
data = morse_create(morse_getBoolSize(message));
morse_encode(message, data);
for (i=0; i<data->length; i++) pc.printf("%d", data->data[i]);
morse_decode(data, message);
pc.printf("\nMessage was : %s\n", message);
while(1);
}