blob: 76f304329872f7fd751b2c34eaf62ff3d2ad76a2 (
plain) (
blame)
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
|
#!/usr/bin/python
"""Simple demo of oscillating colors."""
from __future__ import division, unicode_literals
import color
import constants
import fish_render
import lumiversepython
import time
def get_all_lights(rig):
"""Return a list of all panels."""
return [
[
rig.select('$side={y}[$sequence={x}]'.format({'y': y, 'x': x}))
for y in ('top', 'bot')
] for x in xrange(1, 200)
]
def demo(lights, rig):
"""Do some light things."""
fish = fish_render.Fish(0, 0, 2, 1, color.red, 1 / constants.FRAME_RATE)
bridge = fish_render.Bridge(lights, fish, rig)
while True:
bridge.update()
time.sleep(1 / constants.FRAME_RATE)
def main():
"""Run show."""
rig = lumiversepython.Rig('/home/teacher/Lumiverse/PBridge.rig.json')
rig.init()
lights = get_all_lights(rig)
demo(lights, rig)
if __name__ == '__main__':
main()
|