From ad4be8e33751615101a6ac41b96411d70b45a553 Mon Sep 17 00:00:00 2001 From: Frank DeMarco Date: Tue, 6 Oct 2020 23:53:03 -0400 Subject: [PATCH] don't reset arduino if we're currently getting good input --- NS.py | 5 ++++- config | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NS.py b/NS.py index f2b9e3d..5364708 100644 --- a/NS.py +++ b/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() diff --git a/config b/config index d3d59fc..d3a2953 100644 --- a/config +++ b/config @@ -1,7 +1,7 @@ [setup] license = Public Domain title = Electric Scrapeboard -url = http://A-O.in/ +url = http://shampoo.ooo/games/esb version = 0.2 init-script = OPEN-GAME additional-packages = lib