-
Notifications
You must be signed in to change notification settings - Fork 1
/
Project_02-1.ino
64 lines (50 loc) · 1.18 KB
/
Project_02-1.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//The first project -- S.O.S signal
int ledPin = 10;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
// 3 quick blinks to represent “S”
digitalWrite(ledPin,HIGH);
delay(150);
digitalWrite(ledPin,LOW);
delay(100);
digitalWrite(ledPin,HIGH);
delay(150);
digitalWrite(ledPin,LOW);
delay(100);
digitalWrite(ledPin,HIGH);
delay(150);
digitalWrite(ledPin,LOW);
delay(100);
delay(100); //100 milliseconds as a break of each letter
//3 quick blinks to represent “0”
digitalWrite(ledPin,HIGH);
delay(400);
digitalWrite(ledPin,LOW);
delay(100);
digitalWrite(ledPin,HIGH);
delay(400);
digitalWrite(ledPin,LOW);
delay(100);
digitalWrite(ledPin,HIGH);
delay(400);
digitalWrite(ledPin,LOW);
delay(100);
delay(100);
// 100 milliseconds delay between each letter
//3 quick blinks to represent “S” again
digitalWrite(ledPin,HIGH);
delay(150);
digitalWrite(ledPin,LOW);
delay(100);
digitalWrite(ledPin,HIGH);
delay(150);
digitalWrite(ledPin,LOW);
delay(100);
digitalWrite(ledPin,HIGH);
delay(150);
digitalWrite(ledPin,LOW);
delay(100);
delay(5000); // wait 5 seconds to repeat the next S.O.S.Sssigignnaal
}