Wii NumChuck/Classic Controller Class
Introduction:
Started as an project to try the new 3.0 version of the .NET Micro Framework I wrote a Wii NumChuck class. Soon after I made the NumChuck class I checked if it’s posible to interface the Wii Classic Controller in the same way as this controller has even more buttons, and joysticks. The NumChuck and ClassicController classes are the result of this.
The NumChuck and Classic Controller cost about €20,- so they can be a cheap way to control a devices eg. a robot. Here is a list of the sensors in both controllers:
The NumChuck sensors:
- Analog Stick (X/Y Position)
- 3-Axis acceleration meter (X/Y/Z Axis)
- Two On/Of buttons (C/Z Button)
The Classic Controller sensors:
- Two Analog Sticks (X/Y Position)
- 13 Buttons (Up, Down, Left, Right, +, Home, -, X, Y, A, B, R, L, ZR, ZL)
- R and L also provide the pressure that their pressed with
Both Controllers use an I2c (or TWI) bus to communicate with the Wii Remote. The people of Wii Linux have reverse engineerd the protocol used (Article). With the Pinout descriped there you can easely find out how to connect it to your .NET Micro Framework Board.
Usage:
Both classes are globaly the same. There static classes. You can initialize the interface by calling NumChuck.Initialize() or ClassicController.Initialize(). Both commands start a thread that constantly searches for a connected controller (Both classes can’t be used at the same time, the NumChuck and Classic Controller share the same I2C adress). When a controller is connected the Connected property goes to true and you can read out all buttons/sticks/etc.
Classic Controller Example:
I wrote a simple test program for the Classic Controller class. It displays two crosshairs. One for the left stick and one for the right stick. Also the pressure of the Left and Right top button is displayed. And finaly all pressed buttons are displayed.
You can download the full Visual Studio 2008 solution: MF_Wii_Example_CCenabled.zip
NumChuck Controller Example:
I wrote a simple test program for the NumChuck Controller class. It displays a crosshair for the stick, a 3D cube indicating the X and Y rotation from the accelometer (The Z-Axis isnt displayed) and a C/Z are displayed when the button is pressed.
You can download the full Visual Studio 2008 solution: MF_Wii_Example_NCenabled.zip
Interesting. I found this via a search for “Wii classic controller to USB pinout” in hopes that someone else had something available so I could use the classic controller on the computer if not in a usable product already but a schematic at the very least.
You wouldn’t happen to have done that work or know where one might be able to find it, would you?
The Wii uses I2C as it’s interface protocol so I don’t see why you would need a schematic, but it basically has a ucontroller which implements the I2C protocol and answers to I2C slave requests. The rest of the hardware is built up around the actuator interface, i.e. the buttons and sticks. You could take a look at an NES or SNES controller to get a good idea. The only difference is the inclusion of a couple extra buttons and the pressure sensitive buttons. Other than that, they pretty much look the same to any hardware that talks to them.
I know I’m being anal, but it’s spelled “Nunchuck”.