Wii mote interfacing
The product • It is a wireless device, using standard Bluetooth technology to communicate • The Wii Remote uses the standard Bluetooth human interface device (HID) protocol to communicate with the host, which is directly based upon the USB HID standard (used to describe human interface devices such as the mouse and keyboard)
Wiimote Library for C# • Wiimote. Lib Functions by Brian Peek (http: //www. codeplex. com/Wiimote. Lib and http: //blogs. msdn. com/coding 4 fun/archive/2007/03/14/1879033. aspx) • Supports a handful of report types such as: • • • Buttons - Button data only Buttons. Accel - Button and accelerometer data IRAccel - Button, accelerometer and IR data Buttons. Extension – Button and extension data Extension. Accel - Button, accelerometer and extension data IRExtension. Accel - Button, accelerometer, extension and IR data – The report type can be set by calling the Set. Report. Type method
Sample using Wiimote. Lib; private void Form 1_Load(object sender, Event. Args e) { // create a new instance of the Wiimote wm = new Wiimote(); // setup the event to handle state changes wm. Wiimote. Changed += wm_Wiimote. Changed; // setup the event to handle insertion/removal of extensions wm. Wiimote. Extension. Changed += wm_Wiimote. Extension. Changed; // connect to the Wiimote wm. Connect(); // set the report type to return the IR sensor and accelerometer data (buttons always come back) wm. Set. Report. Type(Wiimote. Input. Report. IRAccel, true); } void wm_Wiimote. Extension. Changed(object sender, Wiimote. Extension. Changed. Event. Args args) { if(args. Inserted) wm. Set. Report. Type(Wiimote. Input. Report. IRExtension. Accel, true); // return extension data else wm. Set. Report. Type(Wiimote. Input. Report. IRAccel, true); // back to original mode } void wm_Wiimote. Changed(object sender, Wiimote. Changed. Event. Args args) { // current state information Wiimote. State ws = args. Wiimote. State; // write out the state of the A button Debug. Write. Line(ws. Button. State. A); }
Other libraries • Wii Device Library • Bobcatwii. Lib
Progress… • Wii Program – Version by Sir Daniel – Detects IR coordinates • What needs to be done – Create new code – Buy bluetooth device – Create a Sensor Bar