Added printing and slowwed updating for debugging.
This commit is contained in:
parent
25c9b953bf
commit
3503474dbe
1 changed files with 4 additions and 3 deletions
|
|
@ -43,7 +43,7 @@ class ProotState:
|
||||||
def next_blink_frame_number(self) -> int:
|
def next_blink_frame_number(self) -> int:
|
||||||
if self.current_blink_state == self.desired_blink_state and self.current_blink_state == 10:
|
if self.current_blink_state == self.desired_blink_state and self.current_blink_state == 10:
|
||||||
self.desired_blink_state = 0
|
self.desired_blink_state = 0
|
||||||
return 10
|
return self.current_blink_state
|
||||||
|
|
||||||
if self.current_blink_state < self.desired_blink_state:
|
if self.current_blink_state < self.desired_blink_state:
|
||||||
self.current_blink_state += 1
|
self.current_blink_state += 1
|
||||||
|
|
@ -201,13 +201,14 @@ def update_screen():
|
||||||
proot_state = ProotState()
|
proot_state = ProotState()
|
||||||
|
|
||||||
if proot_state.get_blinks_frames_ready():
|
if proot_state.get_blinks_frames_ready():
|
||||||
matrix.SwapOnVSync(blinkFrameCanvases[proot_state.next_blink_frame_number()])
|
frame_number = proot_state.next_blink_frame_number()
|
||||||
|
matrix.SwapOnVSync(blinkFrameCanvases[frame_number])
|
||||||
|
|
||||||
|
|
||||||
def interrupt_timer():
|
def interrupt_timer():
|
||||||
while True:
|
while True:
|
||||||
update_screen()
|
update_screen()
|
||||||
time.sleep(0.01)
|
time.sleep(0.05)
|
||||||
|
|
||||||
# Create and start the interrupt thread
|
# Create and start the interrupt thread
|
||||||
screen_update_thread = threading.Thread(target=interrupt_timer)
|
screen_update_thread = threading.Thread(target=interrupt_timer)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue