-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode3-multipleLEDonBreadboard-helper.txt
76 lines (54 loc) · 1.42 KB
/
code3-multipleLEDonBreadboard-helper.txt
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
65
66
67
68
69
70
71
72
73
74
75
76
/*
We have already assigned the pins, you can definitely change if you want to :)
*/
int led1 = // Which pin do you want to use??
int led2 = // Which pin do you want to use??
int led3 = // Which pin do you want to use??
int led4 = // Which pin do you want to use??
int led5 = // Which pin do you want to use??
int led6 = // Which pin do you want to use??
int led7 = // Which pin do you want to use??
int led8 = // Which pin do you want to use??
int delayperiod = 1000 ;
void setup()
{
/*
Assign pins as INPUT/OUTPUT
You may refer to the code for single LED :P
*/
}
void loop()
{
digitalWrite(led1, HIGH);
delay(delayperiod);
digitalWrite(led2, HIGH);
delay(delayperiod);
digitalWrite(led3, HIGH);
delay(delayperiod);
digitalWrite(led4, HIGH);
delay(delayperiod);
digitalWrite(led5, HIGH);
delay(delayperiod);
digitalWrite(led6, HIGH);
delay(delayperiod);
digitalWrite(led7, HIGH);
delay(delayperiod);
digitalWrite(led8, HIGH);
delay(delayperiod);
digitalWrite(led8, LOW);
delay(delayperiod);
digitalWrite(led7, LOW);
delay(delayperiod);
digitalWrite(led6, LOW);
delay(delayperiod);
digitalWrite(led5, LOW);
delay(delayperiod);
digitalWrite(led4, LOW);
delay(delayperiod);
digitalWrite(led3, LOW);
delay(delayperiod);
digitalWrite(led2, LOW);
delay(delayperiod);
digitalWrite(led1, LOW);
delay(delayperiod);
}