diff options
Diffstat (limited to 'bridge.py')
| -rwxr-xr-x | bridge.py | 29 |
1 files changed, 25 insertions, 4 deletions
@@ -1,18 +1,30 @@ #!/usr/bin/python2 """Simple demo of oscillating colors.""" -from __future__ import division, unicode_literals +from __future__ import division, print_function import color import constants -from DummyRig import DummyRig import fish_render +import sunrise import time +import random try: import lumiversepython except ImportError: have_lumiversepython = False + from DummyRig import DummyRig else: have_lumiversepython = True + + + +#fish_render = sunrise + + + + + + def get_all_lights(rig): """Return a list of all panels.""" return [ @@ -27,11 +39,20 @@ def get_all_lights(rig): def demo(lights, rig): """Do some light things.""" - fish = fish_render.Fish(0, 0, 2, 1, color.red, 1 / constants.FRAME_RATE) + #fish = fish_render.Fish(0, 0, 15, 1.5, color.black, 0.05 / constants.FRAME_RATE) + #fish = fish_render.Fish(0, 0, 23, 1.5, color.RGB(193 / 255, 68 / 255, 227 / 255), 0.05 / constants.FRAME_RATE) + fish = fish_render.Fish(0, 0, 23, 1.5, color.black, 0.05 / constants.FRAME_RATE) bridge = fish_render.Bridge(lights, fish, rig) + current_time = time.time() + count = 0 while True: bridge.update() - time.sleep(1 / constants.FRAME_RATE) + if count % constants.FRAME_RATE == 0: + time_delta = time.time() - current_time + print(time_delta) + current_time = time.time() + #time.sleep(1 / constants.FRAME_RATE) + count += 1 def main(): |
