Component knowledge
Joystick
Joystick is a kind of sensor used with your fingers, which is widely used in gamepad and remote controller. It
can shift in direction Y or direction X at the same time. And it can also be pressed in direction Z.
Two rotary potentiometers inside the joystick are set to detect the shift direction of finger, and a push
button in vertical direction is set to detect the action of pressing.
When read the data of joystick, there are some different between axis: data of X and Y axis is analog, which
need to use ADC. Data of Z axis is digital, so you can directly use the GPIO to read, or you can also use ADC
to read.