Files
lerobot/test.py
2025-12-10 11:46:28 +08:00

18 lines
507 B
Python

import time
import pygame
if __name__=="__main__":
pygame.init()
pygame.joystick.init()
joystick = pygame.joystick.Joystick(0)
print(joystick.get_name())
while True:
pygame.event.wait()
a={
"leftx":joystick.get_axis(0),
"lefty":joystick.get_axis(1),
"rightx":joystick.get_axis(2),
"righty":joystick.get_axis(3),
"left_bj":joystick.get_axis(4),
"right_bj":joystick.get_axis(5),
}
print(a)