Description
Project description
Main article: $ How to use an analog module with Arduino $
The KY-023 is an easy-to-use analog joystick. The joystick uses a biaxial potentiometer to control the X and Y axis. It also has an integrated push button. In this tutorial, it is shown how to connect the KY-023 joystick with the Arduino and how to use it.
Wiring schema
Analog module have five pins. Besides the power pins (5V and GND ) the module offers two analog and one digital pins. Analog inputs are used to measure the joystick position and the digital input is used for the button (actually we are using an analog input but it acts as digital).
When the stick is turned all the way in one direction, there are 0 volts going to the pin, and we read 0. When the stick is turned all the way in the other direction, there are 5 volts going to the pin and we read 1023. It applies for both axes (x and y).
Arduino code
We’ve defined two structs (called analog and button ) to represent the state of the analog module. The serial monitor will output the value of X axis, Y axis and button state with 200ms delay to make the output more readable.

Reviews
There are no reviews yet.