-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmdlPreFlight.py
More file actions
35 lines (25 loc) · 752 Bytes
/
mdlPreFlight.py
File metadata and controls
35 lines (25 loc) · 752 Bytes
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
import subprocess as sp
import mdlPil, mdlGFX, ThunderBorg
def PreFlight():
image = mdlPil.creatImage()
image = ControllerCheck(image)
image = TBCheck(image)
mdlGFX.gfxDisplay(image)
return image
def ControllerCheck(image):
stdoutdata = sp.getoutput("hcitool con")
if "00:06:F7:13:66:8F" in stdoutdata.split():
image = mdlPil.Controller(True, image)
else:
image = mdlPil.Controller(False, image)
return image
def TBCheck(image):
TB1 = ThunderBorg.ThunderBorg()
TB1.i2cAddress = 10
TB1.Init()
image = mdlPil.TB(TB1.foundChip, image, 1)
TB2 = ThunderBorg.ThunderBorg()
TB2.i2cAddress = 11
TB2.Init()
image = mdlPil.TB(TB1.foundChip, image, 2)
return image