# Pokémon Macro Ball for Nintendo Switch

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/125/829/medium800/hacks_poke-5680.jpg?1699045100)

Ever get tired of spinning your JoyCon thumbstick endlessly to [evolve Milcery into Alcremie](https://www.youtube.com/watch?v=eDRmoKnB4KU) in Pokémon Sword and Shield? Or get bored riding your Rotom bike in circles to speed up egg hatching? You can create a special Pokéball that is a programmable macro controller for your Nintendo Switch that'll do it for you!

Anything from a simple turbo button mode to a complex macro with multiple buttons and precise timing is possible, thanks to a Raspberry Pi Pico RP2040 microcontroller (or our own [KB2040 Kee Boar](https://www.adafruit.com/product/5302)) and the excellent [GP2040-CE firmware](https://gp2040-ce.info/#/).

You'll create your specific macro with the simple web-based editor, and trigger the action just by plugging the Pokéball into the Switch!

https://youtu.be/Vp-jREGQULk

Info: 

## Parts
Featured
### Raspberry Pi Pico H - Pico with Headers Soldered

[Raspberry Pi Pico H - Pico with Headers Soldered](https://www.adafruit.com/product/5525)
The Raspberry Pi foundation changed single-board computing&nbsp;[when they released the Raspberry Pi computer](https://www.raspberrypi.org/archives/723), now they're ready to do the same for microcontrollers with the release of the brand new&nbsp; **Raspberry Pi Pico H with...**

Out of Stock
[Buy Now](https://www.adafruit.com/product/5525)
[Related Guides to the Product](https://learn.adafruit.com/products/5525/guides)
![Angled shot of a skinny green microcontroller with headers.](https://cdn-shop.adafruit.com/640x480/5525-02.jpg)

or a KB2040

Featured
### Adafruit KB2040 - RP2040 Kee Boar Driver

[Adafruit KB2040 - RP2040 Kee Boar Driver](https://www.adafruit.com/product/5302)
A wild Kee Boar appears! It’s a shiny **KB2040**! An Arduino Pro Micro-shaped board for Keebs with RP2040. (#keeblife 4 evah) A lot of folks like using Adafruit parts for their Keeb builds – but with the ItsyBitsy not being pin-compatible with the Pro Micro pinout, it...

In Stock
[Buy Now](https://www.adafruit.com/product/5302)
[Related Guides to the Product](https://learn.adafruit.com/products/5302/guides)
![Angled shot of short black microcontroller.](https://cdn-shop.adafruit.com/640x480/5302-07.jpg)

Featured
### Premium Female/Female Jumper Wires - 20 x 3" (75mm)

[Premium Female/Female Jumper Wires - 20 x 3" (75mm)](https://www.adafruit.com/product/1951)
These female-female premium jumper wires are handy for making wire harnesses or jumpering between headers on PCB's. They're&nbsp;3" (75mm) long and come in a 'strip' of 20 (2 pieces of each of ten rainbow colors). They have 0.1" female header contacts on either end...

In Stock
[Buy Now](https://www.adafruit.com/product/1951)
[Related Guides to the Product](https://learn.adafruit.com/products/1951/guides)
![Angled shot of Premium Female/Female Jumper Wires - 20 x 3 (75mm)](https://cdn-shop.adafruit.com/640x480/1951-01.jpg)

Featured
### Jumper Shunt with Handle (0.1" / 2.54mm) – 10 Pack

[Jumper Shunt with Handle (0.1" / 2.54mm) – 10 Pack](https://www.adafruit.com/product/3525)
Are you looking to jumper two neighboring male headers (2.54mm apart) without the hassle of maneuvering and re-maneuvering wires? Well then you've _jumped_ to the right page!

This pack of ten (10) 2.54mm&nbsp;jumpers is the perfect solution for quick and compact jumpering....

In Stock
[Buy Now](https://www.adafruit.com/product/3525)
[Related Guides to the Product](https://learn.adafruit.com/products/3525/guides)
![Scattered pile of Jumper Shunts with Handles](https://cdn-shop.adafruit.com/640x480/3525-00.jpg)

Featured
### USB C to Micro B Cable - 1 ft 0.3 meter

[USB C to Micro B Cable - 1 ft 0.3 meter](https://www.adafruit.com/product/3879)
As technology changes and adapts, so does Adafruit! Rather than the regular USB A, this cable has&nbsp; **USB C to Micro B** &nbsp;plugs!

USB C is the latest industry-standard connector for transmitting data _and_ power. Like Lightning and MagSafe cables, USB C has no...

In Stock
[Buy Now](https://www.adafruit.com/product/3879)
[Related Guides to the Product](https://learn.adafruit.com/products/3879/guides)
![USB C to Micro B Cable. 1ft 0.3 meters.](https://cdn-shop.adafruit.com/640x480/3879-02.jpg)

Alternatively, you can use a switched cable and a USB-A socket to USB-C plug adapter so that you can enable the Pokéball macro at the flip of a switch.

Featured
### USB Type C Cable with Data/Charge Switch

[USB Type C Cable with Data/Charge Switch](https://www.adafruit.com/product/4696)
Perhaps your smart phone, tablet, or even your Raspberry Pi 4,&nbsp;charges off of USB, but can you really trust that charging station at the airport? Now you can control when to allow data in or out of your device with this specially-designed USB cable._Voila!_ Your cable's data...

In Stock
[Buy Now](https://www.adafruit.com/product/4696)
[Related Guides to the Product](https://learn.adafruit.com/products/4696/guides)
![Angled shot of coiled USB-C data/charge cable.](https://cdn-shop.adafruit.com/640x480/4696-03.jpg)

Featured
### USB A Socket to USB Type C Plug Adapter

[USB A Socket to USB Type C Plug Adapter](https://www.adafruit.com/product/5030)
If you've got a computer or laptop with a USB C port, [but you're itching to use one of our fancy new Trinkeys](https://www.adafruit.com/?q=trinkey&sort=BestMatch), this adapter will do an excellent job at turning that USB Type C port into a USB A port!

Works great...

In Stock
[Buy Now](https://www.adafruit.com/product/5030)
[Related Guides to the Product](https://learn.adafruit.com/products/5030/guides)
![Angled shot of single back keycap with Adafruit logo plugged via a USB adapter into a laptop. Blue light glows through the keycap.](https://cdn-shop.adafruit.com/640x480/5030-03.jpg)

## Pokéball

You'll need a Pokéball of about 3" diameter that can be opened to house the microcontroller. The one shown was one my son got me at shop in Little Tokyo. Another option is to 3D print one of the many models available on Thingiverse or other model sharing sites.

![hacks_IMG_5614.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/767/medium640/hacks_IMG_5614.jpg?1698858733)

# Pokémon Macro Ball for Nintendo Switch

## Install Firmware and Customize Settings

![](https://cdn-learn.adafruit.com/assets/assets/000/125/830/medium800/hacks_poke-5652.jpg?1699046370)

Convincing a modern game console such as a PlayStation 4 or the Nintendo Switch that a microcontroller is a legitimate gamepad is much trickier than typical USB HID keyboard and mouse techniques we use on computers. This is where the GP2040-CE firmware comes in.

[GP2040-CE](https://gp2040-ce.info/#/installation) is an open source gamepad firmware that's compatible with PC, PS3/PS4, Nintendo Switch, Xbox, and more. It runs on a number of microcontrollers that use the RP2040 chip, such as Pico, [KB2040 Kee Boar](https://www.adafruit.com/product/5302), and more.

Flash the Pico with a drag-and-drop .uf2 file and then customize settings with a web editor.

## Download Firmware

From the [GP2040-CE Downloads page](https://gp2040-ce.info/downloads/), click the Download button for the Raspberry Pi Pico firmware (or the KB2040 link if using that board).

This will save a file named&nbsp;`GP2040-CE_0.7.5_Pico.uf2` (or later) to your download location.

![hacks_picodown.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/778/medium640/hacks_picodown.jpg?1698865674)

## Firmware Installation

[This page](https://gp2040-ce.info/installation) gives detailed instructions on installation, but the basic steps are:

- While holding the BOOTSEL button down, plug the Pico into your computer with a known good data and power USB cable -- this puts the board into **BOOTSEL** /USB drive mode
- A new removeable drive named `RPI-RP2` will appear on your computer
- Drag-and-drop the **CP2040-CE v0.7.5.uf2** (or later) firmware **.uf2** file onto the `RPI-RP2` drive and wait for it to copy the file and reboot itself

![hacks_gp2040-ce-logo.png](https://cdn-learn.adafruit.com/assets/assets/000/125/777/medium640/hacks_gp2040-ce-logo.png?1698865323)

Your Pico reboots as a generic controller, which may work on a Windows PC or Xbox right out of the gate, but you'll want to reconfigure it as a Switch controller with specific behaviors. To do this, we'll launch the built-in Web Configurator!

## Web Configurator

Unplug the Pico from your computer's USB cable. Then, you'll use a short wire to jumper Pico pin GP17 to a GND pin (see attached diagram for physical pin locations).

Plug the Pico into your computer's USB cable while pin GP17 is shorted to ground. After a couple of seconds you can remove the wire. This action has caused the Pico's GP2040-CE firmware to launch a web server you can access from your computer's web browser by visiting http://192.168.7.1

![hacks_fritz_short_S2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/788/medium640/hacks_fritz_short_S2.jpg?1698886430)

![hacks_poke-5654.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/831/medium640/hacks_poke-5654.jpg?1699046418)

![](https://cdn-learn.adafruit.com/assets/assets/000/125/781/medium800/hacks_conf1.jpg?1698866351)

## Settings

You can now update the controller settings. Click on the **Settings** menu item and then switch the **Input Mode** to **Nintendo Switch**.

To do the Auto Spin hack we need to be able to automatically press the left analog stick. Change the **D-Pad Mode** to **Left Analog**.

Then, scroll to the bottom of the settings page and press **Save**.

## Switch Button Test

This is a great time to test the controller on your Switch to make sure basic button presses are working.

The pinout diagram below shows the default GPIO-pin to button mapping.

Plug the Pico into your switch with a known good USB-C to Micro-B data and power [cable](https://www.adafruit.com/product/3879).

You can now use a jumper wire to short any mapped GPIO pin to ground -- those button presses will register on the Switch!&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/125/784/medium800/hacks_RaspberryPiPico_Pinout.jpg?1698866827)

![](https://cdn-learn.adafruit.com/assets/assets/000/125/786/medium800/hacks_macro2.jpg?1698870839)

## Auto Spin Macro

The secret sauce for our Pokéball is the **Macro**  **Settings** section of the configurator. Click the **Configuration** menu item and then click on **Macro**.

- click the **Enabled** button to turn on macro support
- you need to assign a free GPIO pin to be the Macro button (see pinout chart above), set this to `22`
- click the **Activated** button next to the first macro slot
- for clarity, name the macro Label `spin`
- Turn off **Interruptible** so that the Auto Spin will run without interruption
- Leave **Exclusive** on so other controls won't join the mix by accident if buttons are pressed
- you can turn on **Show Frames** if you prefer frame counts for button press timings (vs. milliseconds)
- change the mode dropdown from **Press** to **Hold**  **Repeat** -- this will loop the macro endlessly as long as the button is held
- Click the green **+** button to add a macro line (you can add up to 50 lines!) set it as shown above. This will press **Left** for `6` frames
- Repeat the above step three more times to add **Up** , **Right** , and **Down** events
- Click the **Save** button at the bottom of the page to write the configuration to the Pico

## Reboot

Click the **Reboot** button at the top of the page in order to reboot the Pico.

If you are done changing settings, click **Controller** so the Pico will boot to the regular use mode, then unplug the Pico.

![hacks_reboot.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/787/medium640/hacks_reboot.jpg?1698871267)

## Macro Pin Jumper

To invoke the Auto Spin Macro, short the **GPIO 22** pin to **GND** with a jumper cable.

Then, plug the Pico into the Switch as before&nbsp;-- the Switch we act like you're rapidly spinning the left analog stick!

![hacks_fritz_short_Macro.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/789/medium640/hacks_fritz_short_Macro.jpg?1698886496)

![hacks_poke-5655.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/832/medium640/hacks_poke-5655.jpg?1699046450)

Next, you'll house the device in a Pokéball.

# Pokémon Macro Ball for Nintendo Switch

## Build and Use the Macro Pokéball

![](https://cdn-learn.adafruit.com/assets/assets/000/125/833/medium800/hacks_poke-5650.jpg?1699046753)

## Short Macro Pin

You'll short the macro pin GPIO 22 to ground with a short length of wire (or a [jumper shunt](https://www.adafruit.com/product/3525) if you're fancy, since pin 22 happens to be right next to a ground pin).

You configured the macro to run as long as the "button" is held, so this will stay permanently connected.

![hacks_poke-5656.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/834/medium640/hacks_poke-5656.jpg?1699046774)

![](https://cdn-learn.adafruit.com/assets/assets/000/125/840/medium800/hacks_poke-5657b.jpg?1699053256)

## Ball Prep

Use cutters or a hobby knife to make an opening in the Pokéball for the USB cable.

The ball I had happened to have a coin slot for use as a piggy bank, but the slot wasn't big enough so made the slot a bit bigger.

This will vary depending on the ball you use, or you can add an appropriate opening to a 3D model before printing.

![hacks_poke-5642.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/836/medium640/hacks_poke-5642.jpg?1699052676)

![hacks_poke-5643.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/837/medium640/hacks_poke-5643.jpg?1699052694)

![hacks_poke-5644.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/838/medium640/hacks_poke-5644.jpg?1699052857)

![hacks_poke-5647.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/839/medium640/hacks_poke-5647.jpg?1699052869)

## Catch the Pico!

You probably want to throw your Pokéball into battle to catch the Pico (me too!) but you probably should gently place the Pico inside the ball, plug in the USB cable, then close the Pokéball.

![hacks_poke-5660.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/841/medium640/hacks_poke-5660.jpg?1699053351)

![hacks_poke-5661.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/842/medium640/hacks_poke-5661.jpg?1699053418)

![](https://cdn-learn.adafruit.com/assets/assets/000/125/851/medium800/hacks_poke-5662.jpg?1699054855)

## Plug it In

Start up your Switch, launch your Pokémon game of choice (Shield shown here), and play the game as usual.&nbsp;

To run the Auto Spin Macro, simply plug the Pokéball into the Switch's USB-C port. The Pico powers on and immediately begins to run the macro on loop until you unplug it.

![hacks_poke-5670.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/852/medium640/hacks_poke-5670.jpg?1699054903)

![hacks_poke-5672.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/853/medium640/hacks_poke-5672.jpg?1699054918)

https://youtu.be/Vp-jREGQULk

If you opt for the fancy-pants switchable USB cable (plus A-to-C adapter) you can start your macro simply by flipping the switch to **DATA**. When you're done, flip the switch back to **CHARGE**.

![](https://cdn-learn.adafruit.com/assets/assets/000/125/854/medium800/hacks_poke-5681.jpg?1699139216)

Now go, you gotta catch 'em all!


## Guide Products

### Raspberry Pi Pico H - Pico with Headers Soldered

[Raspberry Pi Pico H - Pico with Headers Soldered](https://www.adafruit.com/product/5525)
The Raspberry Pi foundation changed single-board computing&nbsp;[when they released the Raspberry Pi computer](https://www.raspberrypi.org/archives/723), now they're ready to do the same for microcontrollers with the release of the brand new&nbsp; **Raspberry Pi Pico H with...**

Out of Stock
[Buy Now](https://www.adafruit.com/product/5525)
[Related Guides to the Product](https://learn.adafruit.com/products/5525/guides)
### Adafruit KB2040 - RP2040 Kee Boar Driver

[Adafruit KB2040 - RP2040 Kee Boar Driver](https://www.adafruit.com/product/5302)
A wild Kee Boar appears! It’s a shiny **KB2040**! An Arduino Pro Micro-shaped board for Keebs with RP2040. (#keeblife 4 evah) A lot of folks like using Adafruit parts for their Keeb builds – but with the ItsyBitsy not being pin-compatible with the Pro Micro pinout, it...

In Stock
[Buy Now](https://www.adafruit.com/product/5302)
[Related Guides to the Product](https://learn.adafruit.com/products/5302/guides)
### Premium Female/Female Jumper Wires - 20 x 3" (75mm)

[Premium Female/Female Jumper Wires - 20 x 3" (75mm)](https://www.adafruit.com/product/1951)
These female-female premium jumper wires are handy for making wire harnesses or jumpering between headers on PCB's. They're&nbsp;3" (75mm) long and come in a 'strip' of 20 (2 pieces of each of ten rainbow colors). They have 0.1" female header contacts on either end...

In Stock
[Buy Now](https://www.adafruit.com/product/1951)
[Related Guides to the Product](https://learn.adafruit.com/products/1951/guides)
### Jumper Shunt with Handle (0.1" / 2.54mm) – 10 Pack

[Jumper Shunt with Handle (0.1" / 2.54mm) – 10 Pack](https://www.adafruit.com/product/3525)
Are you looking to jumper two neighboring male headers (2.54mm apart) without the hassle of maneuvering and re-maneuvering wires? Well then you've _jumped_ to the right page!

This pack of ten (10) 2.54mm&nbsp;jumpers is the perfect solution for quick and compact jumpering....

In Stock
[Buy Now](https://www.adafruit.com/product/3525)
[Related Guides to the Product](https://learn.adafruit.com/products/3525/guides)
### USB C to Micro B Cable - 1 ft 0.3 meter

[USB C to Micro B Cable - 1 ft 0.3 meter](https://www.adafruit.com/product/3879)
As technology changes and adapts, so does Adafruit! Rather than the regular USB A, this cable has&nbsp; **USB C to Micro B** &nbsp;plugs!

USB C is the latest industry-standard connector for transmitting data _and_ power. Like Lightning and MagSafe cables, USB C has no...

In Stock
[Buy Now](https://www.adafruit.com/product/3879)
[Related Guides to the Product](https://learn.adafruit.com/products/3879/guides)
### USB Type C Cable with Data/Charge Switch

[USB Type C Cable with Data/Charge Switch](https://www.adafruit.com/product/4696)
Perhaps your smart phone, tablet, or even your Raspberry Pi 4,&nbsp;charges off of USB, but can you really trust that charging station at the airport? Now you can control when to allow data in or out of your device with this specially-designed USB cable._Voila!_ Your cable's data...

In Stock
[Buy Now](https://www.adafruit.com/product/4696)
[Related Guides to the Product](https://learn.adafruit.com/products/4696/guides)
### USB A Socket to USB Type C Plug Adapter

[USB A Socket to USB Type C Plug Adapter](https://www.adafruit.com/product/5030)
If you've got a computer or laptop with a USB C port, [but you're itching to use one of our fancy new Trinkeys](https://www.adafruit.com/?q=trinkey&sort=BestMatch), this adapter will do an excellent job at turning that USB Type C port into a USB A port!

Works great...

In Stock
[Buy Now](https://www.adafruit.com/product/5030)
[Related Guides to the Product](https://learn.adafruit.com/products/5030/guides)

## Related Guides

- [Adafruit KB2040](https://learn.adafruit.com/adafruit-kb2040.md)
- [Motorized Camera Slider 2-Axis](https://learn.adafruit.com/motorized-camera-slider-2-axis.md)
- [Planetary Gear Dreidels](https://learn.adafruit.com/planetary-gear-dreidels.md)
- [USB MIDI Keyset Controller](https://learn.adafruit.com/midi-keyset.md)
- [PB Gherkin 30% keyboard with KMK, CircuitPython, & KB2040](https://learn.adafruit.com/pb-gherkhin-30-keyboard-with-kmk-circuitpython-kb2040.md)
- [Plotting Offline Data - JSONL to CSV files, filters and graphs](https://learn.adafruit.com/plotting-offline-data-jsonl-to-csv-files-filters-and-graphs.md)
- [Match3 Game on the Fruit Jam and  Adafruit Metro RP2350](https://learn.adafruit.com/match3-game-on-metro-rp2350.md)
- [EPCOT Spaceship Earth with WLED](https://learn.adafruit.com/epcot-spaceship-earth-with-wled.md)
- [Arcade Stick Conversion](https://learn.adafruit.com/arcade-stick-conversion.md)
- [Color Spinner Camera Ring Light ](https://learn.adafruit.com/camera-ring-light-with-cpx.md)
- [Fisher-Price USB Controller](https://learn.adafruit.com/fisher-price-usb-controller.md)
- [FunHouse 3D Printed Stand](https://learn.adafruit.com/funhouse-3d-printed-stand.md)
- [NeoPixel Menorah](https://learn.adafruit.com/neopixel-menorah.md)
- [Which CircuitPython Board is Right for You?](https://learn.adafruit.com/choose-your-circuitpython-board.md)
- [NES Emulator for RP2040 & RP2350 DVI Boards](https://learn.adafruit.com/nes-emulator-for-rp2040-dvi-boards.md)
- [Zelda: Breath of the Wild – 3D Printed Bladesaw](https://learn.adafruit.com/bladesaw.md)
