-
Notifications
You must be signed in to change notification settings - Fork 1
/
GPIOProcessor.py
53 lines (31 loc) · 906 Bytes
/
GPIOProcessor.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
from GPIO import GPIO
class GPIOProcessor:
def __init__(self):
self.GPIOList = []
from GPIO import GPIO
def getPin(self, pin_number):
pin = GPIO(pin_number)
pin.openPin()
self.GPIOList.append(pin)
return pin
def getPin21(self):
return self.getPin(6)
def getPin22(self):
return self.getPin(7)
def getPin23(self):
return self.getPin(206)
def getPin24(self):
return self.getPin(207)
def getPin25(self):
return self.getPin(186)
def getPin26(self):
return self.getPin(189)
def getPin27(self):
return self.getPin(22)
def getPin28(self):
return self.getPin(23)
def cleanup(self):
for pin in self.GPIOList:
pin.input()
pin.closePin()
self.GPIOList.remove(pin)