Hi! (in Morse Code)

Description


I used an Arduino with a red LED. I changed the code to light up in a “hi” pattern using Morse Code (… ..). The lights would blink 4 times rapidly (1/5 second on, 1/5 a second off) with a second pause, followed by blinking twice rapidly (1/5 second on, 1/5 second off). I uploaded the code and made sure that it has changed.

Components


  • 1 Arduino
  • 1 LED
  • 1 Resistor (220Ω)
  • 1 Breadboard
  • 1 Macbook Pro
  • 2 jumper cables

Photo


FullSizeRender (1)

Code


modified 31 Aug 2016
 by Sasha Volkov
 */

// the setup function runs once when you press reset or power the board
 void setup() {
 // initialize digital pin 13 as an output.
 pinMode(13, OUTPUT);
 }

// the loop function runs over and over again forever to spell out "hi" in Morse Code
 void loop() {
 digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
 delay(200);
 digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
 delay(200);
 digitalWrite(13, HIGH); // turn the LED off by making the voltage LOW
 delay(200);
 digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
 delay(200);
 digitalWrite(13, HIGH); // turn the LED off by making the voltage LOW
 delay(200);
 digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
 delay(200);
 digitalWrite(13, HIGH); // turn the LED off by making the voltage LOW
 delay(200);
 digitalWrite(13, LOW); // turn the LED off by making the voltage LOW - long pause
 delay(1000);
 digitalWrite(13, HIGH); // turn the LED off by making the voltage LOW
 delay(200);
 digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
 delay(200);
 digitalWrite(13, HIGH); // turn the LED off by making the voltage LOW
 delay(200);
 digitalWrite(13, LOW); // turn the LED off by making the voltage LOW - long pause
 delay(1000);

}

Leave a Reply