forked from whaleygeek/anyio
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathPibrella.py
58 lines (52 loc) · 917 Bytes
/
Pibrella.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
53
54
55
56
57
58
#Pibrella Demo
from time import sleep
t = 0.2
import anyio.GPIO as GPIO
RED = 27
YEL = 17
GRN = 4
BUZZ =18
OUT1 =22
OUT2 =23
OUT3 =24
OUT4 =25
GPIO.setmode(GPIO.BCM)
GPIO.setup(RED, GPIO.OUT)
GPIO.setup(YEL, GPIO.OUT)
GPIO.setup(GRN, GPIO.OUT)
GPIO.setup(OUT1,GPIO.OUT)
GPIO.setup(OUT2,GPIO.OUT)
GPIO.setup(OUT3,GPIO.OUT)
GPIO.setup(OUT4,GPIO.OUT)
try:
while True:
GPIO.output(RED, True)
sleep(t)
GPIO.output(YEL, True)
sleep(t)
GPIO.output(GRN, True)
sleep(t)
GPIO.output(OUT1, True)
sleep(t)
GPIO.output(OUT2, True)
sleep(t)
GPIO.output(OUT3, True)
sleep(t)
GPIO.output(OUT4, True)
sleep(t)
GPIO.output(RED, False)
sleep(t)
GPIO.output(YEL, False)
sleep(t)
GPIO.output(GRN, False)
sleep(t)
GPIO.output(OUT1, False)
sleep(t)
GPIO.output(OUT2, False)
sleep(t)
GPIO.output(OUT3, False)
sleep(t)
GPIO.output(OUT4, False)
sleep(t)
finally:
GPIO.cleanup()