wchill / rp2040-dolphin-kb

RP2040 based adapter to use a Gamecube ASCII keyboard controller via USB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

N64/Gamecube -> Raspberry Pi Pico -> Nintendo Switch

Table of Contents


Description

This code allows a Raspberry Pi Pico to control a Nintendo Switch using button and joystick inputs from an original N64 or Gamecube controller. This is a spiritual successor to my N64-Arduino-Switch project.

Features

Here's a list of some of the larger features of this project

  • Connects to a Nintendo Switch via USB or Bluetooth.
  • Also works with any platform that supports Nintendo Switch Pro controllers.
  • Auto-detects whether the controller is N64 or Gamecube.
  • Dynamically scales each axis of each analog joystick to account for reduced joystick range on old controllers.
  • L + R + Start are mapped to the Switch home button.
  • Supports rumble on Gamecube controllers and N64 controllers with Rumble Paks.

Inspiration

It's been a year since I published the N64-Arduino-Switch project. Since then, the wireless N64 Nintendo Switch controllers have still been largely out of stock and scalped. One of the pieces of feedback from the last project is that it looked intimidating to setup. I've since discovered the Raspberry Pi Pico and decided to redo this project for the Pico. This has 3 advantages over the Arduino project:

  • Programming involves plugging in a Micro USB cable while holding a button, dragging and dropping a file, and you're done! No more installing a Device Firmware Update (DFU) programmer, installing extra libraries, or shorting pins to get the device into a DFU mode.
  • The Pico only costs $4 instead of $10 for an off-brand, slower Arduino!
  • For 2 more dollars than a base Pico, the Pico W microcontroller supports Bluetooth!

Also, when playing through The Legend of Zelda: Ocarina of Time last year on the Arduino version, it was annoying not having a way to go to the Switch's Home screen using the N64 controller. Since I didn't rely on a library to handle N64 controller communication this time, I found out that there is a special 'Reset' bit that's set when L + R + Start are held at the same time. This project maps that input to the Home button on the Switch!

Bluetooth

This is my first project with Bluetooth, so the current version requires you to connect to a Switch in the 'Change Grip/Order' menu. If the Pico becomes disconnected, it may also have to be power cycled to get it to pair with the Switch again. I hope to improve the project so you only have to do this the first time you connect to a Switch, and so it automatically reconnects without power cycling. Also, while the Pico wirelessly connects to the Switch, it will still need to be powered via USB (any USB port - a battery bank should work).

Setup

To program the Raspberry Pi Pico

  1. Hold down the boot sel button on the Pico, and while holding, plug it into your PC via Micro USB cable.
  2. Open the Pico in your File Explorer.
  3. Download the .uf2 file from this repository's most recent release.
  4. Drag and drop the .uf2 file to the Pico folder from step 2.
  5. Done!

Once these steps are done, wire up your N64 controller or your Gamecube controller (pins 1 & 4 only required for rumble support). The pre-built .uf2 file assumes the data pin is on the Pico's GP18 pin. A 1k pullup resistor should also be wired between 3.3v and your data pin to work properly.

3D Printed Enclosure/Plug

I've also designed a small enclosure to house the Pico and act as a plug for a switch controller! More details and files are available here

Credits

This project would have taken a lot longer without the work done by everyone credited in the original N64-Arduino-Switch project along with the creators and contributors of TinyUsb, the GP2040-CE project, and the MPG project. Figuring out how to interface via Bluetooth also took me 1.5 months of work in my off time and would have taken even longer without the work done by Brikwerk on the nxbt project. If you're into developing this sort of stuff, definitely check their stuff out!

About

RP2040 based adapter to use a Gamecube ASCII keyboard controller via USB

License:MIT License


Languages

Language:C++ 53.2%Language:C 44.2%Language:CMake 2.6%