-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathled8.py
47 lines (46 loc) · 804 Bytes
/
led8.py
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
import RPi.GPIO as IO
import time
IO.setwarnings(False)
led1=40
led2=31
led3=33
led4=35
led5=37
led6=38
d=0.6
d1=0.3
d2=0.5
IO.setmode(IO.BOARD)
IO.setup(led1,IO.OUT)
IO.setup(led2,IO.OUT)
IO.setup(led3,IO.OUT)
IO.setup(led4,IO.OUT)
IO.setup(led5,IO.OUT)
IO.setup(led6,IO.OUT)
while(1):
print(0)
IO.output(led1,1)
time.sleep(d)
IO.output(led2,1)
time.sleep(d1)
IO.output(led3,1)
time.sleep(d2)
IO.output(led1,0)
time.sleep(d1)
IO.output(led2,0)
time.sleep(d1)
IO.output(led3,0)
time.sleep(d1)
IO.output(led4,1)
time.sleep(d)
IO.output(led5,1)
time.sleep(d1)
IO.output(led6,1)
time.sleep(d2)
IO.output(led4,0)
time.sleep(d1)
IO.output(led5,0)
time.sleep(d1)
IO.output(led6,0)
time.sleep(d1)
IO.cleanup()