Wii Remotes on Linux using.NET Bindings for libcwiid Jestin Stoffel -
Wii Remotes Multi-Input Device 7 Buttons D-Pad Accelerometer Infrared Sensor/Camera Extension Port
Wii Remotes Multi-Output Device 4 LEDs Rumbler Speaker Communicates with Wii / Computer via Bluetooth
.NET Microsoft created competitor to Sun Microsystem's Java Incorporates multiple languages that compile into the same bytecodes, meaning code written in one langauge can be called in another C# is the flagship language of the.NET platform
Mono Project Open source cross- platform runtime environment for.NET NOT created by Microsoft Enables.NET code to be run on Linux and Apple's OSX Created Gtk widget bindings (Gtk#) for cross- platform applications
cwiid Linux library for communicating with the Wii Remote Written in C Not complete (but no Wii Remote library is) Linux only
Putting It All Together.NET Bindings libbluetooth libcwiid Wrapper Class Easy to use Wiimote class
Code Example
Reporting Modes STATUS BTN ACC IR NUNCHUK CLASSIC EXT
Delegates Remote Delegates ButtonHandler RawAccelHandler BufferedAccelHandler IRHandler Extension Delegates NunchukButtonHandler NunchukAccelHandler NunchuckStickHandler No Classic Controller support yet
Interpreting Accelerometer Data 3-axis accelerometer Pitch and roll can be calculated by measuring gravity Yaw must be calculated by using the IR sensor
Calculating Pitch and Roll Pitch = asin(y / 1g) Roll = asin(x / 1g) Note: x and y need to be converted to vary between -1 and 1, otherwise asin is undefined Calibration is required
Tips and Tricks Accelerometer Buffering Normalizes input Allows higher precision Setting Minimum Response Intervals Specify the minimum time that must pass before recieving input from a delegate Never recieve an event until it's needed
Where do I get MonoWii? From the cwiid subversion repository From me
References and Thanks wiili.org Home of all things Wii on Linux wiibrew.org Website with Wii technical details for use with any operating system Donnie Smith Author of cwiid Marek Wyborski Author of.NET bindings to libcwiid