From 08b5edad8dbe568879c3444623398a2fb6215400 Mon Sep 17 00:00:00 2001 From: fgrossman Date: Wed, 29 Jul 2026 16:37:28 -0400 Subject: [PATCH 1/2] update for buzzer The buzzer code is only for the nano, put import in try just in case. --- XRPLib/resetbot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XRPLib/resetbot.py b/XRPLib/resetbot.py index 727c9ff..d3f1b2d 100644 --- a/XRPLib/resetbot.py +++ b/XRPLib/resetbot.py @@ -29,9 +29,9 @@ def reset_led(): pass def reset_buzzer(): - from XRPLib.buzzer import Buzzer - # Turn off the buzzer + # Turn off the buzzer, buzzer code is only loaded with the Nano board, so we need to put it in the try/except block try: + from XRPLib.buzzer import Buzzer # Turn off the Buzzer if the board has one Buzzer.get_default_buzzer().reset_buzzer() except: From fb4831912445ec031388a4f57169bae69c2775e0 Mon Sep 17 00:00:00 2001 From: fgrossman Date: Fri, 31 Jul 2026 22:48:36 -0400 Subject: [PATCH 2/2] zero gamepad vars at start Since puppet vars stay in memory between runs we need to set them to the values we want when starting. Otherwise the last pushed button may still be pressed. --- XRPLib/gamepad.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/XRPLib/gamepad.py b/XRPLib/gamepad.py index f3f08de..6422836 100644 --- a/XRPLib/gamepad.py +++ b/XRPLib/gamepad.py @@ -88,6 +88,18 @@ def start(self): Signals the remote computer to begin sending gamepad data packets. Subscribes to all gamepad variables at a high rate (50 Hz). """ + + # Initialize all the variables to start with. + + for idx in [self.X1, self.Y1, self.X2, self.Y2]: + var_name = self._VAR_NAMES[idx] + self._puppet.set_variable(var_name, 0.0) + + # Buttons are integers (1 or 0) + for idx in range(4, 18): + var_name = self._VAR_NAMES[idx] + self._puppet.set_variable(var_name, 0) + self._puppet.start() self._puppet.send_program_start()