diff --git a/rpi/antRender.py b/rpi/antRender.py index 2452b1f..6a2d632 100644 --- a/rpi/antRender.py +++ b/rpi/antRender.py @@ -6,6 +6,7 @@ import numpy as np import math from scipy.optimize import linear_sum_assignment import threading +import random print("start configuring matrix") @@ -215,10 +216,25 @@ def interrupt_timer(): update_screen() time.sleep(0.01) -# Create and start the interrupt thread + +def random_blinks(): + while True: + time.sleep(random.randint(5, 10)) + + proot_state = ProotState() + + if proot_state.get_blinks_frames_ready(): + proot_state.blink() + + +# Create and start screen update interrupts screen_update_thread = threading.Thread(target=interrupt_timer) screen_update_thread.start() +# Create and start random blinks interrupts +screen_update_thread = threading.Thread(target=random_blinks) +screen_update_thread.start() + print("start setting ProotScreen") startT = curr_time = round(time.time()*1000)