In this section, we'll perform hardware wiring between the ESP32 and analog joystick. For demo purposes, I will use the ESP-WROVER-KIT v4.1 board. We can connect our analog joystick with the ESP32 on the following wiring:
- Analog joystick 5V is connected to ESP32 5V
- Analog joystick GND is connected to ESP32 GND
- Analog joystick Vx is connected to ESP32 IO35 (ADC1 channel 7)
- Analog joystick Vy is connected to ESP32 IO15 (ADC2 channel 3)
You can see the hardware wiring in figure 3-6, as follows:
Figure 3-6: The wiring for the ESP32 and analog joystick
Next, we write a project for the analog joystick and ESP32.