- Back to Home »
- Arduino , Programming , Week 2 »
- Making a SOS signal
Posted by : Noctis King
Saturday, April 12, 2014
Making a SOS signal
The Arduino program is basic on C++, so it is to learn and program. I make a SOS signal program by using the LED which on the Arduino board.
int led = 13; //set the LED connected to pin 13
void setup() {
pinMode(led, OUTPUT); //set the pin as output
}
//The signal of SOS is three short, three long,
//and three more short flashes of light, so that is
//the LED action. Using loop to loop this process.
void loop() {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
digitalWrite(led, HIGH);
delay(3000);
digitalWrite(led, LOW);
delay(1000);
digitalWrite(led, HIGH);
delay(3000);
digitalWrite(led, LOW);
delay(1000);
digitalWrite(led, HIGH);
delay(3000);
digitalWrite(led, LOW);
delay(1000);
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
delay(1000);
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
delay(1000);
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
delay(1000);
}