WiiClassicControllerReader

Intro

This was written to satisfy the needs of a Senior Design project as a Computer Engineering student at Florida International University. Our team is developing an open-source video game console around the mbed microcontroller. For more details on the mbedGC visit http://www.mbedgc.com/.

I am in charge of the controller interface, and we chose to use the Wii Classic Controller attachment as the main human interface device.

Originally we planned to use the Wii Nunchuk peripheral, so we used the code written by Petras Saduikis, which can be found at http://mbed.org/users/snatch59/programs/WiiNunchuckReader/gpdz49.

In order to provide more control capabilities, we decided to switch to the Classic Controller. This controller also features a more conventional layout, which should appeal to a wider range of users. No code existed for this peripheral, however, so I had to implement my own. In order to save myself some time and headaches, I modified the code from Petras' WiiNunchuckReader to fit our device.

Connections

For our project we're using the WiiChuck adapter. More info on the adapter can be found here http://todbot.com/blog/2008/02/18/wiichuck-wii-nunchuck-adapter-available/.

As defined in I2CConfing.h: Port A corresponds to pins 9 (SDA) and 10 (SCL), while Port B uses pins 28 (SDA) and 27 (SCL). Of course, the adapter ground pin should be connected to the mbed's. For power, connect to the regulated 3.3V out (VOUT).

Demo

The program main.app displays all the values of each button on the controlled, and is refreshed every second. Every value is clearly labeled to make them easier to identify. Each value will be shown as 0 whenever the corresponding button is pressed. A terminal emulator is required to view the data.

Library Files

I2CConfig.h - defines I2C ports and pins.

WiiClassicControllerDefs.h - Classic Controller related defines.

WiiClassicControllerReader.h - WiiClassicControllerReader class declaration.

WiiClassicControllerReader.cpp - WiiClassicControllerReader source.

Import programWiiClassicControllerReader

A program that enables communication between one or two Wii Classic Controllers and the mbed via I2C. Includes a test program that utilizes the PIC Serial Analyzer.


Please log in to post comments.