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):
|
def update(self):
|
||||||
|
if not self.get_animations_ready():
|
||||||
|
print("animation not yet ready")
|
||||||
|
return
|
||||||
self.update_step()
|
self.update_step()
|
||||||
print("at step: " + str(self.transition_count) + " from default in expression: " + str(self.desired_expression))
|
print("at step: " + str(self.transition_count) + " from default in expression: " + str(self.desired_expression))
|
||||||
self.draw_face()
|
self.draw_face()
|
||||||
|
|
|
||||||
|
|
@ -116,8 +116,9 @@ def interrupt_timer():
|
||||||
proot_state = StateSingleton()
|
proot_state = StateSingleton()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
proot_state.update()
|
if proot_state.get_animations_ready():
|
||||||
time.sleep(0.01)
|
proot_state.update()
|
||||||
|
time.sleep(0.01)
|
||||||
|
|
||||||
|
|
||||||
def random_blinks():
|
def random_blinks():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue