Added check for animations readyness before updating state.
This commit is contained in:
parent
d14f75058d
commit
82d0725cfa
2 changed files with 6 additions and 2 deletions
|
@ -81,6 +81,9 @@ class StateSingleton:
|
|||
|
||||
|
||||
def update(self):
|
||||
if not self.get_animations_ready():
|
||||
print("animation not yet ready")
|
||||
return
|
||||
self.update_step()
|
||||
print("at step: " + str(self.transition_count) + " from default in expression: " + str(self.desired_expression))
|
||||
self.draw_face()
|
||||
|
|
|
@ -116,8 +116,9 @@ def interrupt_timer():
|
|||
proot_state = StateSingleton()
|
||||
|
||||
while True:
|
||||
proot_state.update()
|
||||
time.sleep(0.01)
|
||||
if proot_state.get_animations_ready():
|
||||
proot_state.update()
|
||||
time.sleep(0.01)
|
||||
|
||||
|
||||
def random_blinks():
|
||||
|
|
Loading…
Add table
Reference in a new issue