1/* 2 Exercise 1_2 Blink SOS 3 This program blinks SOS in Morse code with an LED: 4 * short-short-short = S 5 * long-long-long = O 6 * short-short-short = S 7 8 This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit. 9*/ 10 11int led = 13; // integer variable led is declared 12 13void setup() { // the setup() method is executed only once 14 pinMode(led, OUTPUT); // the led PIN is declared as digital output 15} 16 17void loop() { // the loop() method is repeated 18 digitalWrite(led, HIGH); // switching on the led 19 delay(200); // stopping the program for 200 milliseconds 20 digitalWrite(led, LOW); // switching off the led 21 delay(200); // stopping the program for 200 milliseconds 22 23 digitalWrite(led, HIGH); // switching on the led 24 delay(200); // stopping the program for 200 milliseconds 25 digitalWrite(led, LOW); // switching off the led 26 delay(200); // stopping the program for 200 milliseconds 27 28 digitalWrite(led, HIGH); // switching on the led 29 delay(200); // stopping the program for 200 milliseconds 30 digitalWrite(led, LOW); // switching off the led 31 delay(200); // stopping the program for 200 milliseconds 32 33 34 digitalWrite(led, HIGH); // switching on the led 35 delay(500); // stopping the program for 500 milliseconds 36 digitalWrite(led, LOW); // switching off the led 37 delay(500); // stopping the program for 500 milliseconds 38 39 digitalWrite(led, HIGH); // switching on the led 40 delay(500); // stopping the program for 500 milliseconds 41 digitalWrite(led, LOW); // switching off the led 42 delay(500); // stopping the program for 500 milliseconds 43 44 digitalWrite(led, HIGH); // switching on the led 45 delay(500); // stopping the program for 500 milliseconds 46 digitalWrite(led, LOW); // switching off the led 47 delay(500); // stopping the program for 500 milliseconds 48 49 50 digitalWrite(led, HIGH); // switching on the led 51 delay(200); // stopping the program for 200 milliseconds 52 digitalWrite(led, LOW); // switching off the led 53 delay(200); // stopping the program for 200 milliseconds 54 55 digitalWrite(led, HIGH); // switching on the led 56 delay(200); // stopping the program for 200 milliseconds 57 digitalWrite(led, LOW); // switching off the led 58 delay(200); // stopping the program for 200 milliseconds 59 60 digitalWrite(led, HIGH); // switching on the led 61 delay(200); // stopping the program for 200 milliseconds 62 digitalWrite(led, LOW); // switching off the led 63 delay(2000); // stopping the program for 2000 milliseconds to have a longer break 64 } 65