-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlinkAll.py
52 lines (40 loc) · 778 Bytes
/
BlinkAll.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
48
49
50
51
52
import RPi.GPIO as GPIO
import time
def init():
GPIO.setmode(GPIO.BCM);
GPIO.setup(17,GPIO.OUT);
GPIO.setup(27,GPIO.OUT);
GPIO.setup(22,GPIO.OUT);
GPIO.setup(23,GPIO.OUT);
def turnOn1():
init();
GPIO.output(17,False);
def turnOn2():
init();
GPIO.output(27,False);
def turnOn3():
init();
GPIO.output(22,False);
def turnOn4():
init();
GPIO.output(23,False);
def turnOffAll():
init();
GPIO.output(17,True);
GPIO.output(27,True);
GPIO.output(22,True);
GPIO.output(23,True);
GPIO.cleanup();
a = 1
while a < 20:
turnOn1()
time.sleep(.2)
turnOn2()
time.sleep(.2)
turnOn3()
time.sleep(.2)
turnOn4()
time.sleep(.2)
turnOffAll()
time.sleep(.2)
a += 1;