This is a simple CircuitPython script that reads the analog joystick and buttons on a 2-axis arcade joystick and sends the data to a computer over USB. The computer can then use the data to control a game or other software.
The script is designed to work with the KevsArcade project.
The script is designed to work with the following hardware:
- KY-023 2 axis joystick module
- Raspberry Pi Pico
- 2x Arcade buttons (Pimoroni)
- Install CircuitPython on the Raspberry Pi Pico (Thonny can make this easy)
- Copy the
code.py
file to the Pico - this will automatically run when the Pico is connected to a computer - Copy the
boot.py
file to the Pico - this will automatically run when the Pico is powered on and set it as a USB HID device - Copy the
hid_gamepad.py
file to the Pico - this is a library that allows the Pico to act as a USB HID device - Connect the joystick and buttons to the Pico as shown in the
wiring.jpg
file - Connect the Pico to the Raspberry Pi using a USB cable