From dfe1127addf7e31acd63e87db0a5d5e35628ea67 Mon Sep 17 00:00:00 2001 From: group1 Date: Sun, 9 Oct 2016 14:45:03 -0400 Subject: Add twinkle --- bridge.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'bridge.py') diff --git a/bridge.py b/bridge.py index 87b339c..4d5d817 100755 --- a/bridge.py +++ b/bridge.py @@ -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(): -- cgit v1.3.1