-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinit_parallel.py
53 lines (44 loc) · 1.37 KB
/
init_parallel.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
import time
import Devices.lightcrafter_230np as _lcr
import Devices.api.dlpc343x_xpr4 as dlp
lcr = _lcr.Lightcrafter(_initGPIO=True)
# Connect ...
res = lcr.connect(_bus=None)
if res[0] == _lcr.ERROR.OK:
try:
# Get LED status ...
res = lcr.getLEDEnabled()
res = lcr.getLEDCurrents()
time.sleep(1.0)
# Set LED currents t0 20 %
res = lcr.setLEDCurrents([0.2, 0.2, 0.2])
res = lcr.getLEDCurrents()
time.sleep(1.0)
# Setting input source to parallel from RPi ...
'''
res = lcr.setInputSource(
_lcr.SourceSel.Parallel,
_width=1920, _height=1080,
_hsync=dlp.Polarity.ActiveLow,
_vsync=dlp.Polarity.ActiveLow
)
'''
'''
res = lcr.setInputSource(
_lcr.SourceSel.Parallel,
_width=1280, _height=720,
_hsync=dlp.Polarity.ActiveHigh,
_vsync=dlp.Polarity.ActiveHigh
'''
res = lcr.setInputSource(
_lcr.SourceSel.Parallel,
_width=960, _height=540,
_hsync=dlp.Polarity.ActiveHigh,
_vsync=dlp.Polarity.ActiveLow
)
time.sleep(1.0)
except _lcr.LCException as excp:
s = _lcr.ErrorStr[excp.value]
print(f"Exception `{s}` ocurred")
# Disconnect ...
lcr.disconnect()