ESP32 MicroPython Joystick Servo Motor

This guide will demonstrate how to control two servo motors or a pan-tilt kit using an ESP32 and a joystick with MicroPython.

A joystick contains two control components, called potentiometers, arranged in a cross pattern, referred to as the X-axis and Y-axis. These potentiometers generate signals, the X-value and Y-value, which come from the VRX and VRY pins of the joystick. These signals are used to control two servo motors: the X-value controls servo motor #1, while the Y-value controls servo motor #2. When used with a pan-tilt kit, the two servo motors work together to move in three dimensions.

The application can be used in two ways: