This project turns your arduino into a sos morse code sender. It sends the code using a LED connected to the digital pin 10.
To build this project you will need:
Build the circuit like the picture above.
Then, upload the following code:
// LED connected to digital pin 10
int ledPin = 10;
// run once, when the sketch starts
void setup()
{
// sets the digital pin as output
pinMode(ledPin, OUTPUT);
}
// run over and over again
void loop()
{
// 3 dits
for (int x=0; x<3; x++) {
digitalWrite(ledPin, HIGH); // sets the LED on
delay(150); // waits for 150ms
digitalWrite(ledPin, LOW); // sets the LED off
delay(100); // waits for 100ms
}
// 100ms delay to cause slight gap between letters
delay(100);
// 3 dahs
for (int x=0; x<3; x++) {
digitalWrite(ledPin, HIGH); // sets the LED on
delay(400); // waits for 400ms
digitalWrite(ledPin, LOW); // sets the LED off
delay(100); // waits for 100ms
}
// 100ms delay to cause slight gap between letters
delay(100);
// 3 dits again
for (int x=0; x<3; x++) {
digitalWrite(ledPin, HIGH); // sets the LED on
delay(150); // waits for 150ms
digitalWrite(ledPin, LOW); // sets the LED off
delay(100); // waits for 100ms
}
// wait 5 seconds before repeating the SOS signal
delay(5000);
}
When finished, the arduino will start blinking the LED with the SOS morse signal.
That's it!
References:
http://www.labdegaragem.org/loja/index.php/47-livros/arduino-basico...
Comment by Ed Goulart on February 2, 2013 at 2:23pm Indeed a nice code!
A good challenge would be not to repeat the second "di-di-dit", redirecting the program to the first routine.
Comment
Christian Rheinnecker replied to abhishek yadav's discussion how to record time between two events using arduion
Christian Rheinnecker posted a status
Christian Rheinnecker posted a video
GarageLab posted a blog post
GarageLab posted a blog post
abhishek yadav posted a discussion
Danny Vigo commented on Fernando Gil's blog post Tutorial: Servomotor + Arduino
Danny Vigo replied to SATYA NARAYANA REDDY NIMMAKAYALA's discussion 5 stepper motor control code
Christian Rheinnecker posted a status
Christian Rheinnecker posted a video© 2013 Created by Marcelo Rodrigues.

You need to be a member of GarageLab (arduino, electronics, robotics, hacking) to add comments!
Join GarageLab (arduino, electronics, robotics, hacking)