← Back

Joystick mouse

Built on XDAI built a computer mouse with an ESP32, and it's both amazing and absolutely terribleBy Adam Conway
ESP32-S3-DevKitC-1

KY-023 analog joystick

+5V3V3SWGPIO17VRyGPIO18VRxGPIO8GNDGND

Compatibility checks

1 warning

  • GPIO18 on KY-023 analog joystick stops reading if your project turns on Wi-Fi.

Wiring steps

  1. 1

    KY-023 analog joystick

    • GNDtoGND
    • +5Vto3V3
    • VRxtoGPIO8
    • VRytoGPIO18
    • SWtoGPIO17
  2. 2

    Turn on the internal pull-up on GPIO17 in your code.

  3. 3

    Plug in the USB cable last.

Arduino pins

Use these pins in your sketch.

const int KY_023_VRX = 8;
const int KY_023_VRY = 18;
const int KY_023_SW = 17;

void setup() {
  pinMode(KY_023_SW, INPUT_PULLUP);
}

void loop() {
}

Some board drawings are from Wokwi and Seeed Studio.