[Library Release] Joystick Library for ESP32-S3 + HW-504 (MicroPython) #18152
kuyeon
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I’ve made a simple MicroPython library for using the HW-504 joystick module with the ESP32-S3.
The library provides methods to read normalized values (read()), raw ADC values (read_raw()), directions (read_direction()),
and even angle/magnitude. You can also calibrate the joystick and adjust the deadzone.
This makes it easy to detect directions like “up”, “down”, “left”, or “right” and handle button presses.
The library was tested with MicroPython v1.26.1 on firmware ESP32_GENERIC_S3-20250911-v1.26.1.bin.
The wiring is straightforward:
VCC → 3.3V, GND → GND, VRX → GPIO12, VRY → GPIO13, and SW → GPIO11.
Here’s a quick example:
from joystick import Joystick
joy = Joystick()
x, y, button = joy.read()
print(x, y, button)
The code is available here: [Joystick Library]. Feedback and suggestions are welcome!
Beta Was this translation helpful? Give feedback.
All reactions