Automate repetitive tasks in Pokémon Legends: Z-A using a Raspberry Pi Pico that emulates a HORI POKKEN CONTROLLER. Automatically registers as a controller, launches the game, and performs in-game actions like fast traveling for re-rolling Pokémon spawns
Hardware:
Tested on Nintendo Switch 1 and the load times may vary on different models. Check and adjust delays accordingly.
Software:
- Arduino IDE - arduino.cc
- Board Package - Earle Philhower's arduino-pico
- Library - Adafruit TinyUSB Library
"Adafruit TinyUSB" is bundled with
arduino-pico, but you may need to install it via Library Manager if not available.
- Install Arduino IDE from here.
- Open Arduino IDE and add the
arduino-picoboard package:- Go to
File→Preferences(orSettingson macOS) and add the following URL to the "Additional Board URLs" field:https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json - Select
Tools→Board Manager→ Search forrp2040 - Install "Raspberry Pi Pico/RP2040/RP2350" by Earle F. Philhower, III
- Go to
- Restart Arduino IDE to apply changes.
- Clone this repository or download the ZIP and extract it.
- Open one of the
.inomacro files in Arduino IDE.
- Connect Raspberry Pi Pico to your computer while holding the
BOOTSELbutton to enter USB mass storage mode. - Open the macro
.inofile in Arduino IDE. - In Arduino IDE, configure the following:
- Select
Board:Tools→Board→Raspberry Pi Pico - Select
Port:Tools→Port→ (Select the Pico's port) - Select
USB Stack:Tools→USB Stack→Adafruit TinyUSB
- Select
- Upload the sketch to the Pico: Click the upload button (right arrow icon).
- Launch Pokémon Legends: Z-A and fast travel to the location where you want to reroll spawns. Do not move the controller.
- Navigate to the Switch home screen → Controllers → Change Grip/Order
- Plug in the Pico to the switch
- Wait for auto-registration and check for a USB Pro Controller connection for Player 1.
- Once registered, the macros will exit out of the controller menu and launch the game automatically.
- The macro will then start performing fast travel actions at the selected location.
Ensure that the correct
.inofile is uploaded for the desired fast travel point
To stop: Disconnect Pico or press HOME on a real controller.
This script is "blind" and relies entirely on timing.
- Adjust Timing: If the macro runs too fast (e.g., presses 'A' before the map is open), increase the
delay()values in theloop()function. - Change Actions: You can edit the
loop()to do anything you want. Use the helper functions:pressButton(BTN_A, 100);- (Buttons:
BTN_A,BTN_B,BTN_X,BTN_Y,BTN_L,BTN_R,BTN_ZL,BTN_ZR,BTN_PLUS,BTN_MINUS,BTN_HOME)
- (Buttons:
pressDPad(DPAD_UP, 100);- (Directions:
DPAD_UP,DPAD_DOWN,DPAD_LEFT,DPAD_RIGHT, etc.)
- (Directions:
moveStick(STICK_RIGHT, STICK_CTR, 40);- (Moves the Left Stick. (X, Y, duration))
-
Q: My computer won't detect my Pico after uploading!
- A: This is normal! The script tells your PC it's a controller, not a Pico. To re-upload, you must force it into
BOOTSELmode:
- Unplug the Pico.
- Press and HOLD the BOOTSEL button on the Pico.
- While holding it, plug the Pico back into your computer.
- Release the button. It will appear as a drive. You can now upload again.
- A: This is normal! The script tells your PC it's a controller, not a Pico. To re-upload, you must force it into
-
Q: My controller isn't recognized by the Switch.
- A: Go to
Tools → USB Stackand make sure it is set toAdafruit TinyUSB.
- A: Go to
-
Q: The macro gets stuck or misses buttons.
- A: Your Switch is loading slower than the script expects. Increase the
delay()values in theloop()orsetup()function.
- A: Your Switch is loading slower than the script expects. Increase the
- Hardware: Raspberry Pi Pico by Raspberry Pi Ltd. — https://www.raspberrypi.com/products/raspberry-pi-pico/
- IDE: Arduino IDE by Arduino — https://www.arduino.cc/en/software
- Board core: arduino-pico by Earle F. Philhower, III — https://github.com/earlephilhower/arduino-pico
- USB stack: Adafruit TinyUSB Library and TinyUSB (Hå Thạch, Adafruit) — https://github.com/adafruit/Adafruit_TinyUSB_Arduino • https://github.com/hathach/tinyusb
- HID spec: USB HID Usage Tables by USB-IF — https://usb.org/document-library/hid-usage-tables-15
- Controller ID: HORI CO., LTD. "POKKÉN CONTROLLER" VID/PID used for Switch compatibility
Trademarks: Nintendo Switch and Pokkén are trademarks of their respective owners. This project is not affiliated with or endorsed by Nintendo or HORI.
Educational purposes only. Automation may violate Nintendo's Terms of Service. Use at your own risk. Not responsible for account bans, save data loss, or hardware damage.
Author: Abhilesh (@abhilesh)