how to: Morse Code with Arduino

so this is my first project with Arduino but it's tiny. it's cool though! 8)

so, i used:
Arduino UNO
Red LED

here is the code: this code says,
mike
that's my dads
name

void setup() {

pinMode(13, OUTPUT);
}

void loop(){
digitalWrite(13, HIGH);
delay(2000);
digitalWrite(13, LOW);
delay(2000);
digitalWrite(13,HIGH);
delay(1000);
digitalWrite(13,LOW);
delay(1000);
digitalWrite(13,HIGH);
delay(2000);
digitalWrite(13,LOW);
delay(1000);
digitalWrite(13,HIGH);
delay(2000);
digitalWrite(13,LOW);
delay(1000);

}

Good for you for starting to learn programing!

Welcome to the Arduino Forum, and to the fun world of Arduino programming and tinkering. You have chosen a fun starting project with a red LED to blink out Morse Code that spells out your father's name. A very good start, and I'll tell you that I myself learned Morse Code 40 years ago (around the age of 11), when I first obtained my HAM radio license.

Your arduino program is off to a good start. I want to point out, though that your LED actually will blink 4 times (then repeat), but will not actually spell out the word "mike" which I think is your initial intent.

We all know that the word Mike is made up of 4 letters, but in Morse Code, each letter is made up of different combinations of "dots" and "dashes".

Your father's name, Mike is actually made up of the following Morse Code dot/dash combinations:

M = -- (that's 2 dashes --)
I = .. (that's 2 dots ..)
K = -.- (that's a dash followed by a dot followed by another dash)
E = . (that's 1 dot)

In spoken terms a dash (-) is actually called a "dah", and a dot (.) is actually called a "dit"

So, your Dad's name Mike is spoken as follows:

M = dah dah
I = dit dit
K = dah dit dah
E = dit

To spell out the Morse Code on your LED, each dot/dash or dit/dah has to light up on your LED for a certain amount of time. If you count the dits and dahs in your dad's name you will see there are a total of 8. That means that you want to light up your LED a total of 8 times, but right now your code will only light up the LED 4 times before the code repeats itself. In order to light the LED 8 times you have to turn it on THEN off 8 different times.

Next you will have to pay attention to the length of time the LED is ON and the lenght of time the LED is off.

In true Morse Code, the dit has a length of 1, and the dah has a length of 3. That means that however long you want the "dit" to be ON (the LED) you want the "dah" to be on 3 times as long as the "dit."

Then there is the OFF time between the "dits" and the "dahs". The space between dits/dahs in the same letter is 1, and the space between letters (like M I K E in your dad's name) is 3.

You can find out a lot more information about Morse Code including all the dit/dah combinations for letters and numbers, as well as the spacing between by looking here on Wikipedia:

I like your project so far! Keep up the learning and the good work, and I wish you and your dad lots of fun and luck with this project and more in the future!

--dsmavis

I am going to use morse codes for 2 attinys. I want to be able to use potentiometers to conrol eachother's led. I am going to try it with ultrasound first. Morse code is fun project

thanks everyone, just so you know i built this by myself. i will be posting more soon