Skip to content

Add USB Serial GameCube Controller Example for Pico SDK - #2

Closed
stack-teapot wants to merge 1 commit into
loopj:mainfrom
stack-teapot:main
Closed

stack-teapot wants to merge 1 commit into
loopj:mainfrom
stack-teapot:main

Conversation

@stack-teapot

Copy link
Copy Markdown
Contributor

Description

This PR adds a new example demonstrating how to use the Pico SDK with libjoybus to simulate a GameCube controller over USB serial. The example allows button presses to be sent from a USB serial terminal to the Raspberry Pi Pico, which then acts as a GameCube controller on RP2XXX devices.

Changes Included

  • examples/pico-sdk/gcn-controller-target/usb_serial/main.c — USB serial GameCube controller implementation.
  • examples/pico-sdk/gcn-controller-target/usb_serial/CMakeLists.txt — Build configuration for Pico SDK and libjoybus.
  • examples/pico-sdk/gcn-controller-target/usb_serial/.gitignore — Ignores the build directory.
  • examples/pico-sdk/gcn-controller-target/usb_serial/README.txt — Documentation including build, flash, and usage instructions.

Notes

  • Builds using standard Pico SDK and libjoybus setup.
  • Supports all main GameCube buttons via simple USB serial input.
  • Build output (build/) is ignored; users must have Pico SDK and libjoybus checked out locally.

Usage

  1. Build the example with:
cmake -B build -DPICO_ENABLE_STDIO_USB=1 -DPICO_ENABLE_STDIO_UART=0 -DPICO_BOARD=pico2 -DPICO_PLATFORM=rp2350 . 
cmake --build build

@stack-teapot

Copy link
Copy Markdown
Contributor Author

Hi! I just wanted to say thank you for this project it really helped me with a remote GameCube playing project I’m working on. I appreciate all the work you’ve put into this!

@loopj

loopj commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Thanks for this, and sorry it sat for so long! The library API changed quite a bit since you opened it, so I've rebased your commit onto main and built on top of it in #66. Your commit is kept as-is, so you're credited in the history.

The main change is that the computer now sends the full controller state (buttons, both sticks and triggers) as a line of hex, rather than one character per button. This makes holds, combos and analog input possible. Closing this in favor of #66. Thanks again!

@loopj loopj closed this Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants