summaryrefslogtreecommitdiffstats
path: root/bridge.py
diff options
context:
space:
mode:
Diffstat (limited to 'bridge.py')
-rwxr-xr-xbridge.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/bridge.py b/bridge.py
index 87b339c..88d49ba 100755
--- a/bridge.py
+++ b/bridge.py
@@ -1,15 +1,16 @@
#!/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 time
+import random
try:
import lumiversepython
except ImportError:
have_lumiversepython = False
+ from DummyRig import DummyRig
else:
have_lumiversepython = True
@@ -27,11 +28,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():