Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions XRPLib/gamepad.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions XRPLib/resetbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down