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)
|
Animation.update(self)
|
||||||
last_frame_duration = self.time_filter.get_last_frame_duration()
|
last_frame_duration = self.time_filter.get_last_frame_duration()
|
||||||
if self.serial_enabled() or True:
|
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 \
|
if self.title.active or self.introduction.active or self.ending.active or \
|
||||||
self.dialogue.active:
|
self.dialogue.active:
|
||||||
self.no_reset_elapsed += last_frame_duration
|
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:
|
if self.no_reset_elapsed >= self.NO_RESET_TIMEOUT:
|
||||||
print("auto arduino reset triggered")
|
print("auto arduino reset triggered")
|
||||||
self.reset_arduino()
|
self.reset_arduino()
|
||||||
|
|
2
config
2
config
|
@ -1,7 +1,7 @@
|
||||||
[setup]
|
[setup]
|
||||||
license = Public Domain
|
license = Public Domain
|
||||||
title = Electric Scrapeboard
|
title = Electric Scrapeboard
|
||||||
url = http://A-O.in/
|
url = http://shampoo.ooo/games/esb
|
||||||
version = 0.2
|
version = 0.2
|
||||||
init-script = OPEN-GAME
|
init-script = OPEN-GAME
|
||||||
additional-packages = lib
|
additional-packages = lib
|
||||||
|
|
Loading…
Reference in New Issue