# Connecting the Joystick to the ESP32

Let's connect the joystick to the ESP32. We need to connect the VRX and VRY pins to the ADC pins of the ESP32. The joystick will be powered with 3.3V instead of 5V because the ESP32's GPIO pins are only 3.3V tolerant. Connecting it to 5V could damage the ESP32's pins. Thankfully, the joystick can operate at 3.3V as well.


<table>
  <thead>
    <tr>
      <th>ESP32 Pin</th>
      <th style="width: 250px; margin: 0 auto;">Wire</th>
      <th>Joystick Pin</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>GND</td>
      <td style="text-align: center; vertical-align: middle; padding: 0;">
        <div class="wire black" style="width: 200px; margin: 0 auto;">
          <div class="male-left"></div>
          <div class="male-right"></div>
        </div>
      </td>
      <td>GND</td>
    </tr>
    <tr>
      <td>3.3V</td>
      <td style="text-align: center; vertical-align: middle; padding: 0;">
        <div class="wire red" style="width: 200px; margin: 0 auto;">
          <div class="male-left"></div>
          <div class="male-right"></div>
        </div>
      </td>
      <td>VCC</td>
    </tr>
    <tr>
      <td>GPIO 13</td>
      <td style="text-align: center; vertical-align: middle; padding: 0;">
        <div class="wire green" style="width: 200px; margin: 0 auto;">
          <div class="male-left"></div>
          <div class="male-right"></div>
        </div>
      </td>
      <td>VRX</td>
    </tr>
    <tr>
      <td>GPIO 14</td>
      <td style="text-align: center; vertical-align: middle; padding: 0;">
        <div class="wire blue" style="width: 200px; margin: 0 auto;">
          <div class="male-left"></div>
          <div class="male-right"></div>
        </div>
      </td>
      <td>VRY</td>
    </tr>
    <tr>
      <td>GPIO 32</td>
      <td style="text-align: center; vertical-align: middle; padding: 0;">
        <div class="wire yellow" style="width: 200px; margin: 0 auto;">
          <div class="male-left"></div>
          <div class="male-right"></div>
        </div>
      </td>
      <td>SW</td>
    </tr>
  </tbody>
</table>

<img style="display: block; margin: auto;margin-top:30px;" alt="connecting joystick with esp32" src="./images/connecting joystick with esp32.png"/>
