Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
pressed = self.buttons.get_pressed()
dead = 15000
x = self.joy_x.value - 32767
if x < -dead:
pressed |= K_LEFT
elif x > dead:
pressed |= K_RIGHT
y = self.joy_y.value - 32767
if y < -dead:
pressed |= K_UP
elif y > dead:
pressed |= K_DOWN
return pressed
buttons = Buttons()
audio = stage.Audio(board.SPEAKER, board.SPEAKER_ENABLE)