Joysticks
A joystick is a very commonly known device in the gaming world. The working principle of a joystick is to monitor the variance on the x-axis and y-axis. In a conventional joystick, two potentiometers are connected on both the x and y-axes in 2D. The variation in the potential is observed with the help of a driver circuit. The initial position of a joystick is in the center. Based on the position of the joystick, the variance is calculated using the driver circuit. The driver circuit will calculate the value to locate its actual position – that is, up, down, right, and left. It also has a push button on the center position, which can be programmed. The joystick has five pins:
- Ground (GND) and supply (VCC): Connected to the ground and the supply
- VRx or Hor: Reads the values from the x axis
- VRy or Ver: Reads the values from the y axis
- SW: The switch or push button
In Figure 9.12, the connection of a joystick can be observed: