SunFounder ESP32 Starter Kit
4.16.2 You Will Learn
• How Joystick module works
• Set the x and y coordinates of the sprite
4.16.3 Build the Circuit
A joystick is an input device consisting of a stick that pivots on a base and reports its angle or direction to the device it
is controlling. Joysticks are often used to control video games and robots.
In order to communicate a full range of motion to the computer, a joystick needs to measure the stick’s position on two
axes - the X-axis (left to right) and the Y-axis (up and down).
The motion coordinates of the joystick are shown in the following figure.
Note:
• The x coordinate is from left to right, the range is 0-4095.
• y coordinate is from top to bottom, range is 0-4095.
Now build the circuit according to the following diagram.
4.16. 2.13 GAME - Star-Crossed 571