int ledPin = 13; // Define interface 9
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
// Three short flashes to represent the letter "S"
for (int x = 0; x < 3; x++) {
digitalWrite(ledPin, HIGH); // Set LED to ON
delay(500); // Delay for 500 milliseconds
digitalWrite(ledPin, LOW); // Set LED to OFF
delay(500); // Delay for 500 milliseconds
}
// Delay of 200 milliseconds to create a gap between letters
delay(200);
// Three long flashes to represent the letter "O"
for (int x = 0; x < 3; x++) {
digitalWrite(ledPin, HIGH); // Set LED to ON
delay(1500); // Delay for 1500 milliseconds
digitalWrite(ledPin, LOW); // Set LED to OFF
delay(500); // Delay for 500 milliseconds
}
// Delay of 100 milliseconds to create a gap between letters
delay(100);
// Three short flashes to represent the letter "S" again
for (int x = 0; x < 3; x++) {
digitalWrite(ledPin, HIGH); // Set LED to ON
delay(500); // Delay for 500 milliseconds
digitalWrite(ledPin, LOW); // Set LED to OFF
delay(500); // Delay for 500 milliseconds
}
// Wait for 5 seconds before repeating the S.O.S signal
delay(5000);
}