don't reset arduino if we're currently getting good input
This commit is contained in:
parent
7b92f7ee12
commit
ad4be8e337
5
NS.py
5
NS.py
|
@ -199,10 +199,13 @@ class NS(Game, Animation):
|
|||
Animation.update(self)
|
||||
last_frame_duration = self.time_filter.get_last_frame_duration()
|
||||
if self.serial_enabled() or True:
|
||||
# self.apply_serial()
|
||||
self.apply_serial()
|
||||
if self.title.active or self.introduction.active or self.ending.active or \
|
||||
self.dialogue.active:
|
||||
self.no_reset_elapsed += last_frame_duration
|
||||
# if we received good input, reset the auto reset timer
|
||||
if 0b11 <= self.serial_data <= 0b1100:
|
||||
self.no_reset_elapsed = 0
|
||||
if self.no_reset_elapsed >= self.NO_RESET_TIMEOUT:
|
||||
print("auto arduino reset triggered")
|
||||
self.reset_arduino()
|
||||
|
|
Loading…
Reference in New Issue