Managed Library for Nintendo's Wiimote

Published 14 March 07 01:05 AM | Coding4Fun 
  In this article, Brian Peek demonstrates how to connect to and use the Nintendo Wiimote from C# and VB.NET. The final output is an easy-to-use managed API for the Wiimote that can be used in any managed application.
ASPSOFT, Inc.

Difficulty: Intermediate
Time Required: 1-3 hours
Cost: Less Than $50 (Free if you already own a Wiimote)
Software: Visual C# or Visual Basic 2008 Express Editions
Hardware: Nintendo Wii Remote (Wiimote), a compatible PC Bluetooth adapter and stack
Download: CodePlex
 

Updates

6/15/08 – Version 1.5.2 is now up at CodePlex.  The Balance Board should really work this time….

6/12/08 - Version 1.5.1 has been removed from CodePlex...it has proven to be too buggy for most users (though it continues to work just fine for me).  Look for version 1.5.2 soon...

6/11/08 – Version 1.5.1 posted at CodePlex.  Fixed a bug with the Balance Board…  UPDATE:  It appears some people are still having issues with this build as well due to some Balance Boards being a bit finicky in their response times.  Stay tuned for build 1.5.2 soon…

6/9/08 – Version 1.5 posted at CodePlex.  The Wii Fit Balance Board is now supported.

6/3/08 – New version 1.4 posted at the download link above.  The big change is multiple Wiimotes are now finally supported.

5/27/08 - New version 1.3 posted at the download link above.  Lots of changes, so be sure to read the included docs!

1/29/08 - New version 1.2.1.0 posted at the download link above.  The only change for this release is adding support for IR3 and IR4 since I've gotten so many questions about it.

10/22/07 - New version 1.2.0.0 posted at the download link above.  There are a variety of fixes and new features added.  The source code and binary releases are now hosted at CodePlex.  A .chm help file is also included documenting the API itself.  Please note that a license is now included with the library which explicitly defines how the library can be used.  For 99% of you, this won't change anything, but I've received tons of emails asking about restrictions, so now there's something official attached.  Check out the readme.txt and license.txt in the docs directory included with the official distribution for more information.

6/12/07 - New version 1.1.0.0 posted at the download link above.  This fixes several issues, adds an alternate writing method which may help those with troubled bluetooth stacks/adapters, adds Vista/XP x64 support, and a Microsoft Robotics Studio service version of the library.  See the included readme.txt for more information.  Additionally, see my new article on using the new MSRS service to create a Wiimote-controlled car!

3/17/07 - New version 1.0.1.0 posted at the download link above.  This fixes a bug with the calibration data being stored by the API.  Thanks to James Darpinian for the catch!

Introduction

Nintendo's Wii Remote (forever known as the Wiimote) is a fantastic little controller for the Nintendo Wii system.  Because it uses Bluetooth to communicate with the Wii, it can be connected to and used by practically any Bluetooth capable device.

If you care to just use the library and are not concerned with the implementation details, skip down to the usage section.

Before we get started, there are two websites that one should peruse before reading the code contained here.  These two sites have done 99% of the work of figuring out the data that is sent and received with the Wiimote.  I am not going to repeat most of this information here since both of the these sites explain the protocol so thoroughly.  Without the work of the people posting to these sites, none of this would have been possible.

Getting Connected

This will likely be the biggest sticking point.  The Wiimote will not pair and communicate successfully with every Bluetooth device and stack on the planet.   There's little I can do to help get you connected if the following steps do not work.  Either it's going to work, or it isn't.  Cross your fingers...

  1. Start up your Bluetooth software and have it search for a device.
  2. Hold down the 1 and 2 buttons on the Wiimote.  You should see the LEDs at the bottom start flashing.  Do not let go of these buttons until this procedure is complete.  If pairing the Wii Fit Balance Board, open the battery cover on the underside of the balance board and hold the little red sync button.
  3. Wiimotes should show up in the list of devices found as Nintendo RVL-CNT-01.  Balance Boards will show up as Nintendo RVL-WBC-01.  If it's not there, start over and try again.
  4. Click Next to move your way through the wizard.  If at any point you are asked to enter a security code or PIN, leave the number blank or click Skip.  Do not enter a number.
  5. You may be asked which service to use from the Wiimote.  Select the keyboard/mouse/HID service if prompted (you should only see one service available).
  6. Finish the wizard.

That's it.  The LEDs at the bottom should continue to flash and you should see the device listed in your list of connected Bluetooth devices.  If you run the test application included with the source code and you see the numbers change, you are all set.  If you don't see them change or you get an error, try the above again.  If it continues to not function, you are likely stuck with an incompatible device or stack.

The Exciting World of HID and P/Invoke

When the Wiimote is paired with your PC, it will be identified as a HID-compliant device.  Therefore, to connect to the device, we must use the HID and Device Management Win32 APIs.  Unfortunately there is no built-in support for these APIs in the current .NET runtime, so we must enter the realm of P/Invoke.  These APIs are defined in the Windows Driver Kit (WDK) so if you wish to see the original C header files or read the API documentation, you will need to download and install the latest WDK.

P/Invoke, as you probably know, allows one to directly call methods of the Win32 API from .NET.  The difficulty of this is finding the right method signatures and structure definitions which will properly marshal the data through to Win32.  A great resource for these signatures is the P/Invoke wiki.  Almost all of the methods used in this project were defined by this resource.  For this project, all P/Invoke'd methods live in the HIDImports class.

The process to begin communication with the Wiimote is as follows:

  1. Get the GUID of the HID class defined by Windows
  2. Get a handle to the list of all devices which are part of the HID class
  3. Enumerate through those devices and get detailed information about each
  4. Compare the Vendor ID and Product ID of each device to the known Wiimote's VID and PID
  5. When found, create a FileStream to read/write to the device
  6. Clean up the device list

 

In code, the process is as follows (shortened from the original code for space):

VB

' read/write handle to the device
Private mHandle As SafeFileHandle

' a pretty .NET stream to read/write from/to
Private mStream As FileStream
Private found As Boolean = False
Private guid As Guid
Private index As UInteger = 0

' 1. get the GUID of the HID class
HIDImports.HidD_GetHidGuid(guid)

' 2. get a handle to all devices that are part of the HID class
Dim hDevInfo As IntPtr = HIDImports.SetupDiGetClassDevs(guid, Nothing, IntPtr.Zero, HIDImports.DIGCF_DEVICEINTERFACE) ' | HIDImports.DIGCF_PRESENT);

' create a new interface data struct and initialize its size
Dim diData As HIDImports.SP_DEVICE_INTERFACE_DATA = New HIDImports.SP_DEVICE_INTERFACE_DATA()
diData.cbSize = Marshal.SizeOf(diData)

' 3. get a device interface to a single device (enumerate all devices)
Do While HIDImports.SetupDiEnumDeviceInterfaces(hDevInfo, IntPtr.Zero, guid, index, diData)
' create a detail struct and set its size
Dim diDetail As HIDImports.SP_DEVICE_INTERFACE_DETAIL_DATA = New HIDImports.SP_DEVICE_INTERFACE_DETAIL_DATA()
diDetail.cbSize = 5 'should be: (uint)Marshal.SizeOf(diDetail);, but that's the wrong size

Dim size As UInt32 = 0

' get the buffer size for this device detail instance (returned in the size parameter)
HIDImports.SetupDiGetDeviceInterfaceDetail(hDevInfo, diData, IntPtr.Zero, 0, size, IntPtr.Zero)

' actually get the detail struct
If HIDImports.SetupDiGetDeviceInterfaceDetail(hDevInfo, diData, diDetail, size, size, IntPtr.Zero) Then
' open a read/write handle to our device using the DevicePath returned
mHandle = HIDImports.CreateFile(diDetail.DevicePath, FileAccess.ReadWrite, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, HIDImports.EFileAttributes.Overlapped, IntPtr.Zero)

' 4. create an attributes struct and initialize the size
Dim attrib As HIDImports.HIDD_ATTRIBUTES = New HIDImports.HIDD_ATTRIBUTES()
attrib.Size = Marshal.SizeOf(attrib)

' get the attributes of the current device
If HIDImports.HidD_GetAttributes(mHandle.DangerousGetHandle(), attrib) Then
' if the vendor and product IDs match up
If attrib.VendorID = VID AndAlso attrib.ProductID = PID Then
' 5. create a nice .NET FileStream wrapping the handle above
mStream = New FileStream(mHandle, FileAccess.ReadWrite, REPORT_LENGTH, True)
Else
mHandle.Close()
End If
End If
End If

' move to the next device
index += 1
Loop

' 6. clean up our list
HIDImports.SetupDiDestroyDeviceInfoList(hDevInfo)

C#

// read/write handle to the device
private SafeFileHandle mHandle;

// a pretty .NET stream to read/write from/to
private FileStream mStream;
bool found = false;
Guid guid;
uint index = 0;

// 1. get the GUID of the HID class
HIDImports.HidD_GetHidGuid(out guid);

// 2. get a handle to all devices that are part of the HID class
IntPtr hDevInfo = HIDImports.SetupDiGetClassDevs(ref guid, null, IntPtr.Zero, HIDImports.DIGCF_DEVICEINTERFACE);// | HIDImports.DIGCF_PRESENT);

// create a new interface data struct and initialize its size
HIDImports.SP_DEVICE_INTERFACE_DATA diData = new HIDImports.SP_DEVICE_INTERFACE_DATA();
diData.cbSize = Marshal.SizeOf(diData);

// 3. get a device interface to a single device (enumerate all devices)
while(HIDImports.SetupDiEnumDeviceInterfaces(hDevInfo, IntPtr.Zero, ref guid, index, ref diData))
{
// create a detail struct and set its size
HIDImports.SP_DEVICE_INTERFACE_DETAIL_DATA diDetail = new HIDImports.SP_DEVICE_INTERFACE_DETAIL_DATA();
diDetail.cbSize = 5; //should be: (uint)Marshal.SizeOf(diDetail);, but that's the wrong size

UInt32 size = 0;

// get the buffer size for this device detail instance (returned in the size parameter)
HIDImports.SetupDiGetDeviceInterfaceDetail(hDevInfo, ref diData, IntPtr.Zero, 0, out size, IntPtr.Zero);

// actually get the detail struct
if(HIDImports.SetupDiGetDeviceInterfaceDetail(hDevInfo, ref diData, ref diDetail, size, out size, IntPtr.Zero))
{
// open a read/write handle to our device using the DevicePath returned
mHandle = HIDImports.CreateFile(diDetail.DevicePath, FileAccess.ReadWrite, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, HIDImports.EFileAttributes.Overlapped, IntPtr.Zero);

// 4. create an attributes struct and initialize the size
HIDImports.HIDD_ATTRIBUTES attrib = new HIDImports.HIDD_ATTRIBUTES();
attrib.Size = Marshal.SizeOf(attrib);

// get the attributes of the current device
if(HIDImports.HidD_GetAttributes(mHandle.DangerousGetHandle(), ref attrib))
{
// if the vendor and product IDs match up
if(attrib.VendorID == VID && attrib.ProductID == PID)
{
// 5. create a nice .NET FileStream wrapping the handle above
mStream = new FileStream(mHandle, FileAccess.ReadWrite, REPORT_LENGTH, true);
}
else
mHandle.Close();
}
}

// move to the next device
index++;
}

// 6. clean up our list
HIDImports.SetupDiDestroyDeviceInfoList(hDevInfo);

CreateFile and SafeFileHandles

If you read through the above code, you may have noticed that the handle to the Wiimote is opened using Win32's CreateFile function instead of directly using a FileStream object or some other managed way.  This is required due to the way that the handle needs to be created.  The DevicePath member of the detail struct contains a non-file system path that Win32 can use to open a handle to the device.  The .NET methods for performing this action will only allow file system paths, so we must use the Win32 method instead.

You will also notice that we use the SafeFileHandle object to wrap the handle returned from the call to CreateFile.  The SafeFileHandle object wraps a native Win32 handle and allows one to safely manage the native type and cleanly close things up at the end of the application.  One could just as easily use an IntPtr, but I have found that this is a much cleaner method for dealing with the native type.

Wiimote I/O and HID Reports

In the world of HID, data is sent and received as "reports".  Simply, it is a data buffer of a pre-defined length with a header that determines the report contained in the buffer.  The Wiimote will send and can receive various reports, all of which are 22 bytes in length, and all of which are explained at the links above.  Given the number and complexity, I suggest you read through the wikis above if you wish to know more about the Wiimote's reports and the data they contain.

Now that we have a a FileStream on which to communicate with the Wiimote, we can start communication.  Because reports will be sent and received almost constantly, it is essential that asynchronous I/O operations are used.  In .NET, this is quite simple.  The process is to start an asynchronous read operation and provide a callback method to be run when the buffer is full.  When the callback is run, the data is handled and the process is repeated.

VB 

' sure, we could find this out the hard way using HID, but trust me, it's 22
Private Const REPORT_LENGTH As Integer = 22

' report buffer
Private mBuff As Byte() = New Byte(REPORT_LENGTH - 1){}

Private Sub BeginAsyncRead()
' if the stream is valid and ready
If mStream.CanRead Then
' create a read buffer of the report size
Dim buff As Byte() = New Byte(REPORT_LENGTH - 1){}

' setup the read and the callback
mStream.BeginRead(buff, 0, REPORT_LENGTH, New AsyncCallback(AddressOf OnReadData), buff)
End If
End Sub

Private Sub OnReadData(ByVal ar As IAsyncResult)
' grab the byte buffer
Dim buff As Byte() = CType(ar.AsyncState, Byte())

' end the current read
mStream.EndRead(ar)

' start reading again
BeginAsyncRead()

' handle data....
End Sub

C#

// sure, we could find this out the hard way using HID, but trust me, it's 22
private const int REPORT_LENGTH = 22;

// report buffer
private byte[] mBuff = new byte[REPORT_LENGTH];

private void BeginAsyncRead()
{
// if the stream is valid and ready
if(mStream.CanRead)
{
// create a read buffer of the report size
byte[] buff = new byte[REPORT_LENGTH];

// setup the read and the callback
mStream.BeginRead(buff, 0, REPORT_LENGTH, new AsyncCallback(OnReadData), buff);
}
}

private void OnReadData(IAsyncResult ar)
{
// grab the byte buffer
byte[] buff = (byte[])ar.AsyncState;

// end the current read
mStream.EndRead(ar);

// start reading again
BeginAsyncRead();

// handle data....
}

That's it!

You may not believe it, but that code is enough to open and start communicating with the Wiimote.  The rest of the code involves parsing the data sent from the Wiimote and writing properly formed data to the Wiimote.  As I said, I'm not going to go into the detail of the reports as the sites above will do a much better job than I, but one can write any command to the Wiimote simply by doing the following:

VB


mStream.Write(mBuff, 0, REPORT_LENGTH)

C#


mStream.Write(mBuff, 0, REPORT_LENGTH);

Reading is done with the async code you see above.  When a report of 22 bytes is received, the OnReadData method is called, and the data can be properly parsed and used.

Usage of the API

If you don't care about the implementation details, you've likely skipped down to this section to learn how to use the API in your own application.  The easiest way to learn how it all works is to look at the WiimoteTest application included with the source code.

captured_Image.png

First, you will need to add a reference to the WiimoteLib.dll included with the source code.  Next, you will need to pull the namespace into your application with the standard using/Imports statement.  With that in place, you can now create an instance of the Wiimote class and start using it.  Simply instantiate a new instance of the Wiimote class, setup events if you wish to use them, setup the report type of the data you want to be returned, and call the Connect method.

VB

Imports WiimoteLib

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
' create a new instance of the Wiimote
Dim wm As Wiimote = New Wiimote()

' setup the event to handle state changes
AddHandler wm.WiimoteChanged, AddressOf wm_WiimoteChanged

' setup the event to handle insertion/removal of extensions
AddHandler wm.WiimoteExtensionChanged, AddressOf wm_WiimoteExtensionChanged

' connect to the Wiimote
wm.Connect()

' set the report type to return the IR sensor and accelerometer data (buttons always come back)
wm.SetReportType(Wiimote.InputReport.IRAccel, True)
End Sub


Private Sub wm_WiimoteExtensionChanged(ByVal sender As Object, ByVal args As WiimoteExtensionChangedEventArgs)
If args.Inserted Then
wm.SetReportType(Wiimote.InputReport.IRExtensionAccel, True) ' return extension data
Else
wm.SetReportType(Wiimote.InputReport.IRAccel, True) ' back to original mode
End If
End Sub

Private Sub wm_OnWiimoteChanged(ByVal sender As Object, ByVal args As WiimoteChangedEventArgs)
' current state information
Dim ws As WiimoteState = args.WiimoteState

' write out the state of the A button
Debug.WriteLine(ws.ButtonState.A)
End Sub

C#

using WiimoteLib;

private void Form1_Load(object sender, EventArgs e)
{
// create a new instance of the Wiimote
Wiimote wm = new Wiimote();

// setup the event to handle state changes
wm.WiimoteChanged += wm_WiimoteChanged;

// setup the event to handle insertion/removal of extensions
wm.WiimoteExtensionChanged += wm_WiimoteExtensionChanged;

// connect to the Wiimote
wm.Connect();

// set the report type to return the IR sensor and accelerometer data (buttons always come back)
wm.SetReportType(Wiimote.InputReport.IRAccel, true);
}


void wm_WiimoteExtensionChanged(object sender, WiimoteExtensionChangedEventArgs args)
{
if(args.Inserted)
wm.SetReportType(Wiimote.InputReport.IRExtensionAccel, true); // return extension data
else
wm.SetReportType(Wiimote.InputReport.IRAccel, true); // back to original mode
}

void wm_WiimoteChanged(object sender, WiimoteChangedEventArgs args)
{
// current state information
WiimoteState ws = args.WiimoteState;

// write out the state of the A button
Debug.WriteLine(ws.ButtonState.A);
}

If you wish to use multiple Wiimotes, instantiate a WiimoteCollection object, call the FindAllWiimotes method to initialize it, and then use each individual Wiimote object in the collection as a separate instance.

VB

Dim wc As New WiimoteCollection()
wc.FindAllWiimotes()

For Each wm As Wiimote In wc
AddHandler wm.WiimoteChanged, AddressOf wm_WiimoteChanged
AddHandler wm.WiimoteExtensionChanged, AddressOf wm_WiimoteExtensionChanged

wm.Connect()
wm.SetReportType(InputReport.IRAccel, True)
Next wm

C#

WiimoteCollection wc = new WiimoteCollection();
wc.FindAllWiimotes();

foreach(Wiimote wm in wc)
{
wm.WiimoteChanged += wm_WiimoteChanged;
wm.WiimoteExtensionChanged += wm_WiimoteExtensionChanged;

wm.Connect();
wm.SetReportType(InputReport.IRAccel, true);
}

Data can be retrieved from the API in two ways:  events and polling.  In event mode, one must subscribe to the WiimoteChanged event as shown above.  Then, when data is sent from the Wiimote to the PC, an event will be posted to your event handler for processing in your application.  If you elect to not use the event model, you may simply retrieve state information at any time from the WiimoteState property of the Wiimote class.

Report Types

The library currently supports only a handful of the many report types the Wiimote is capable of producing, however the ones that are implemented are enough to get all required data for the Wiimote and all current extensions.  Specifically, these reports are:

  • Buttons - Button data only
  • ButtonsAccel - Button and accelerometer data
  • IRAccel - Button, accelerometer and IR data
  • ButtonsExtension – Button and extension data
  • ExtensionAccel - Button, accelerometer and extension data
  • IRExtensionAccel - Button, accelerometer, extension and IR data

The report type can be set by calling the SetReportType method using the appropriate report type and whether or not you would like the data to be sent continuously or only when the state of the controller has changed.

Extensions

There are currently three Wii extensions supported by the library: the Nunchuk, the Classic Controller, and the Guitar Hero controller.  If you wish to use these, you must setup an event handler for the WiimoteExtensionChanged event.  When this event is called, you can check the event argument to determine if an extension was inserted or removed, and what type extension was inserted.  In this event handler, you will need to change the report type with the SetReportType method to one that supports extension data, otherwise the data will not be returned to you.

If you are using a strictly polled method, you may also check the Extension and ExtensionType parameters of the WiimoteState property to determine when an extension has been inserted or removed.

The Wii Fit Balance Board will show up as a Wiimote controller with an extension attached.  The report type is set internally and any attempt to set a new report type on this device will be ignored.  The power button maps to the Wiimote’s A button, and the LED maps to the Wiimote’s LED1.  The rest of the Wiimote’s properties are ignored.  The remainder of the balance board information can be found in the BalanceBoard struct inside the WiimoteState object.

State Information

The heart of the entire library is contained in the WiimoteState object.  Check the download's included .chm help file for the full set of properties available. 

To Do...

At the moment, usage of the speaker on the Wiimote is not supported.  I will likely add this in a future update.  Additionally, there are several report types which are not implemented, however the reports which are implemented return all necessary information.  I would also like to add some "higher level" functionality that will return pitch/roll angles, mouse cursor position for the IR sensor, etc.  Check this article and my blog for information on updates to the library.

Conclusion

And there we have it.  A fully functional managed library for the Wiimote.  Give it a try and integrate it into your existing applications or build something new!  I'm looking forward to some creative uses of the library...

If you have any issues using the library, or have any feature requests (other than sound), please don't hesitate to contact me directly or post a message in my forum dedicated to the project.

Enjoy!

Links

Bio

Brian is a Microsoft C# MVP who has been actively developing in .NET since its early betas in 2000, and who has been developing solutions using Microsoft technologies and platforms for even longer. Along with .NET, Brian is particularly skilled in the languages of C, C++ and assembly language for a variety of CPUs. He is also well-versed in a wide variety of technologies including web development, document imaging, GIS, graphics, game development, and hardware interfacing. Brian has a strong background in developing applications for the health-care industry, as well as developing solutions for portable devices, such as tablet PCs and PDAs. Additionally, Brian has co-authored the book "Debugging ASP.NET" published by New Riders, and is currently co-authoring a book titled "10 Coding4Fun Projects with .NET for Programmers, Hobbyists, and Game Developers" to be published by O'Reilly in late 2008. Brian also writes for MSDN's Coding4Fun website, contributing articles on a monthly basis.

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# End Lands » Managed Library for Nintendo's Wiimote said on March 14, 2007 2:33 PM:

PingBack from http://endlands.org/managed-library-for-nintendos-wiimote/

# voodooflux » Blog Archive » Using the Wiimote from .NET said on March 14, 2007 2:33 PM:

PingBack from http://www.junitech.com/blogs/voodooflux/?p=38

# » Managed Library for Nintendo's Wiimote said on April 1, 2007 7:44 PM:

PingBack from http://libraryblogs.info/managed-library-for-nintendos-wiimote/

# Trossen Robotics » Blog Archive » Managed .NET Library for Nintendo’s Wiimote said on April 2, 2007 3:03 PM:

PingBack from http://blog.trossenrobotics.com/index.php/2007/04/02/managed-net-library-for-wiimote/

# Coding4Fun said on April 5, 2007 3:04 PM:

The University of Western Australia has created a cheap way to navigate immersive 3D environments . To

# Stephen Todd said on April 9, 2007 6:40 AM:

I could not connect my Wiimote to a Lenovo 3000 N100 using 'My Bluetooth Places' ~ 'View Devices in Range'.  I failed to pair;  'Skip' had no effect.

However, with the standard stack and going via the "bluetooth Setup Wizard", using 'Skip' on the pairing worked.  It is now doing at least most things right (checking using GlovePie)

# Emmanuel Deloget said on April 11, 2007 10:14 AM:

This is utterly awesome. The next step is to have it work with the Xbox360 as an XNA component. Wait, it's not possible... Oh, that's pretty bad :/

Anyway, can't wait to see little XNA-powered Windows games that will use this neat piece of technology (because that should be possible, right?)

# Bud said on April 12, 2007 4:35 PM:

Thanks Brian!

For a moderately-skilled programmer like myself, having a simple to use library like this one is fabulous.

I created a [[ManagedWii]] topic on WiiLi wiki, it was a real shame for that community not to have any direct links back to this great work of yours for this beautiful little controller.  I hope you don't mind...

Please, as soon as you can find the time, continue and finish implementing your other ideas for this library.

I'm developing an XNA game, and I'm planning to integrate the Wiimote on the PC at least, right alongside my 360 controller for the PC.

Bud

***

xpost to your other blog

# New Theme and Wii Drums Update said on April 13, 2007 8:18 AM:

PingBack from http://www.bobsomers.com/2007/04/12/new-theme-and-wii-drums-update/

# Robert Burke's Weblog said on April 13, 2007 8:43 AM:

One of my favourite game designers of all time, Tim Schafer (Grim Fandango, Full Throttle, Psychonauts)

# Lindsay Manning said on April 17, 2007 4:24 AM:

I used your Library for my PC / Wiimote Happy Slapper game. Thanks very much for that, it is a great piece of code.

I also took 2 more libraries from elsewhere (msbts, and wcbts) Widcomm and MS bluteooth stack drivers to try and incorporate connection from within your Library but the amount of code needed for both types of Bluetooth stack makes it a bit cumbersome to do nicely.

# Oleg Deuschle said on April 19, 2007 1:06 PM:

Hi everyone! Got a Problem!

Does someone know how to get this work on an Apple MacBook running Vista Business(native)?

I can connect my Wiimote via Bluetooth to my Mac with Vista running, but wenn I start the WiimoteTest

I will get an "Unhandled Exception" Error;

saying that wiimote maybe not be connected.

But if I continue to launch the WiimoteTest, the signal's when i press the Button's on the controller are recognized, but not the MotionSensor,Accelerator, BatteryStatus etc.

Any help would be great!

# Rick, Collierville, TN said on April 22, 2007 10:52 PM:

Brian:

Works right out of the box with a Dell D620 using the built-in bluetooth with the Toshiba stack.

Thanks!

# standard-brain said on April 24, 2007 9:42 AM:

hey,

really nice work! i actually had a strange behaviour:

the buttons work but the accelerometers don't. do you

have an idea why?

would like to use the accels...

thanks,

sb

# Robert Burke's Weblog said on April 25, 2007 7:44 AM:

Here's a flock of butterflies, brought to you in XNA, which can be directed with the Wii controller.

# Brian's Blog said on April 25, 2007 2:26 PM:

Anyone heading out to Mix this year? I'll be there once again, but this time I'll be (partly) working

# Mykres Space said on April 25, 2007 6:22 PM:

Robert Burke has put together a small sample of using the XNA Framework, the Wii Controller and a bunch

# How Do Wii Control Game Development? at Video Gamer Designer said on April 27, 2007 6:58 PM:

PingBack from http://videogamerdesigner.com/20/wiimote-enabled-games/

# Alex said on April 29, 2007 7:08 PM:

I've managed to sucessfully connect the wiimote to my dell truemobile 350 bluetooth card.  It won't connect using the standard bluetooth stack but you have to download the Toshiba version from Dell's website.

# Richard Cruz said on May 1, 2007 9:06 PM:

That was easier than i thought. It took me about two tries. = ]

# Marcus Wolschon said on May 4, 2007 5:21 AM:

We can use our Wii just fine using GlovePIE and the MS-Stack but strangly Wiimote gives us Exceptions after conecting. The Wii is found in the iteration over all HID-Devices.

Wiimote.cs Line 755

Method: ReadData()

Line: "if(!mReadDone.WaitOne(2500, false))"

Marcus@Woslchon.biz

# pho said on May 6, 2007 4:43 PM:

i'm getting an exception on

if (!mReadDone.WaitOne(2500, false))

               throw new Exception("Error reading data from Wiimote...is it connected?");

but the wiimote DOES connect in windows (lights keep flashing. am i stuck with an incompatible stack then?)

# pho said on May 6, 2007 4:46 PM:

what's also weird, is that wiimote-api (tested with their gui) DOES work... :s

# Coding4Fun said on May 8, 2007 3:12 PM:

Microsoft at Maker Faire 2007 May 19th-20th San Mateo, CA

# Brian's Blog said on May 9, 2007 12:44 AM:

I will be attending this year's Maker Faire with the Coding4Fun gang. We will have a variety of spiffy

# Sirus Jolt said on May 12, 2007 3:17 AM:

Yeah, umh, i like download the soft, but the page redirection me to Channel 9 and i cant make a new account in theh page. Help me, please!!!.

# syphadias said on May 14, 2007 2:19 PM:

I have downloaded this and have my work's Microsoft Visual Studio installed and am curious to see how this works and learn. I have done much lower level programming on PICs previously and would be grateful if someone could tell me how to compile and run everything in the zip. thanks very much

# Evan said on May 16, 2007 9:52 PM:

I just made a nifty wiimote drum kit using a (much pared down) version of your code.  Check it out at http://www.thisisnotalabel.com/My-Wiimote-Drum-Kit.php

I gave credit to Brian at the bottom; I hope that's enough.

# Brian's Blog said on May 17, 2007 6:26 PM:

I've received a couple emails in the past week of people using my Managed Wiimote Library to do some

# Pate LIVE! » Blog Archive » .NET Framework and the Wiimote said on May 20, 2007 10:58 AM:

PingBack from http://blog.patelive.com/2007/05/18/net-framework-and-the-wiimote/

# Martin said on May 21, 2007 1:53 PM:

thx, I used in under Windows XP and it worked well. In Windows Vista with it's integrated Bluetooth software it didn't work for me. Your code allways prints out an unknown report type ("Unknown report type: 34").

# BenZC said on May 25, 2007 7:59 AM:

Hi,

I use an EPoX Bluetooth USB Dongle and BlueSoleil Software under WindowsXP and its works just fine.

But when I used it under Windows Vista problems occured. When I use the standard Windows Bluetooth Software the code founds the Wiimote but I cannot communicate with it (not connected exception) and when I use the BlueSoleil Software the code dont even find the wiimote. However i can succesfull connect to the Wiimote with the BlueSoleil Software.

Any suggestions.

# Angelremanufacture - Bling Bling Blog » Blog Archive » Wiimote Drum said on May 25, 2007 8:11 AM:

PingBack from http://www.angelremanufacture.com/blog/2007/05/25/wiimote-drum/

# lightsaber said on May 29, 2007 12:46 PM:

This is so cool.

I can only imagine what this might look like if you turn the Wiimote into a lightsaber, and control the lights in the room with wooosh movements.

I mean, all that's left is controlling the lights via the USB, using eg. ambint light system from http://www.a-r-e.nl

Imagine that !!

# ascII| said on June 1, 2007 6:43 PM:

sry i forgot

GREAT JOB  ||  VERY USEFULL

ascII(Germany)

---blabla same then last post :D ---

# Coding4Fun said on June 12, 2007 4:17 AM:

In this article, Brian Peek will demonstrate how to use his Managed Wiimote Library and Microsoft Robotics

# Brian's Blog said on June 12, 2007 4:30 AM:

My latest article has been posted at MSDN's Coding4Fun site . This article explains how to create a Wiimote

# wont work... said on June 12, 2007 4:37 PM:

ok... im not good at understanding errors... im taking a useless vb course and am confused... when i try to run the program using visual basic express edition it gives me the error

"A project with an Output Type of Class Library cannot be started directly

In order to debug this project, add an executable project to this solution which references the library project. Set the executable project as the startup project"

please help me... and dont make fun of me... im just really confused right now

# Roberto Sonnino on Windows, Tech, .net said on June 12, 2007 7:20 PM:

Fala galera,Não sei quantos de vocês são felizardos de terem um Nintendo Wii ou um Wiimote, mas esses...

# Virtual Dreams » Dica COOL: Biblioteca .net para Wiimote! said on June 12, 2007 7:20 PM:

PingBack from http://virtualdreams.com.br/blog/2007/06/dica-cool-biblioteca-net-para-wiimote/

# M Leach said on June 13, 2007 9:34 PM:

Your patch for vista compatibility is much appreciated. The AltWriteMethod change was effective for me as well, fyi.

# Cyphexx said on June 18, 2007 2:27 PM:

To everyone using the WiimoteLib:

Be careful not to use one Wiimote in multiple threads. The exceptions and error messages can get pretty messy.

You can, actually, edit the Connect() Method to support Multiple Wiimotes at once (next to the "Found!!!" debug message). These individual Wiimote objects can then indeed be used in seperate threads.

A big Dankeschön to Brian Peek for his libary at this position, it is a lot fun to play around with it :)

# Brian's Blog said on July 2, 2007 4:30 AM:

The following is a list of the applications that I know about using my .NET Managed Library for the Nintendo

# Brian Peek [MVP C#] said on July 2, 2007 4:30 AM:

The following is a list of the applications that I know about using my .NET Managed Library for the Nintendo

# Brian's Blog said on July 2, 2007 4:31 AM:

I've received a few more emails from folks using my Managed Wiimote Library to do some cool things with

# Brian Peek [MVP C#] said on July 2, 2007 4:31 AM:

I've received a few more emails from folks using my Managed Wiimote Library to do some cool things

# Coding4Fun said on July 2, 2007 10:56 AM:

Chad Hower over at Indy Project has built a tool that will give any presentation that extra bang. A PowerPoint

# Noticias externas said on July 2, 2007 11:29 AM:

Chad Hower over at Indy Project has built a tool that will give any presentation that extra bang. A PowerPoint

# F??bio Pedrosa » Wii Key said on July 3, 2007 9:02 PM:

PingBack from http://www.fabiopedrosa.info/2007/07/04/wii-key/

# Mischa Kroon said on July 12, 2007 11:15 AM:

In my opinion the future of games and other interfaces will be one where motion detection will be a key

# du-hude said on July 13, 2007 1:09 PM:

Hi. When i open the sln, i keep getting the project is under source control, an error occurred registering this  project with cource control. i cant get around this error because when i lauch visual sourcesafe the project is not list and i cannot unbind it. weird!!! please help.

# Olaf Köhler said on July 18, 2007 11:44 AM:

Please could you help me?

Everytime, when I insert the Nunchuck some time later this message came in front:

System.Exception

Couldn't read Data from the WiiMote...Is it Connected?

... Yes it is, and I dont have any idea what the problem is.

I hope, you can help me, sorry for my bad english

Olaf

# Olaf Köhler said on July 18, 2007 11:53 AM:

2nd Part

Sometimes he also told me about an unkown addition "125"

# thuanta.com - Building a Wii “Sensor” Bar project said on July 23, 2007 2:52 AM:

PingBack from http://thuanta.com/2007/07/23/wiisensorbar/

# Will Pressly said on July 26, 2007 2:00 AM:

Brian -- great library! One problem though -- the nunchuck is not noticed by the sample program (or other programs I have written) unless you do one of two things: 1. Somewhere in the code there is a call to wm.GetBatteryLevel();, or 2. you disconnect and reconnect the nunchuck.... Try it in your example code above... comment the GetBatteryLevel in the Form1_Load routine, and see if the nunchuck is ready... It looks like there might not be a bit being flipped somewhere...

# Coding4Fun said on July 26, 2007 2:52 AM:

In this article, Brian Peek will demonstrate how to use his Managed Wiimote Library and Microsoft Robotics

# Nic Lyons said on August 3, 2007 2:36 PM:

I got your Wiimote Test up and running and was looking at the IRState code which I assume outputs into the black rectangle in the lower left.  Does that work with any bright light source (I tried with an incandescent desk lamp but received no outputs) or is an IR source required?

Thanks for making this available!  Nice clean code.

# Wiimote used in XNA dev presentation [update] at Best-Computer-Deals.net said on August 6, 2007 4:41 PM:

PingBack from http://www.best-computer-deals.net/2007/08/06/wiimote-used-in-xna-dev-presentation-update/

# LifeParticles.com » Wiimote used in XNA dev presentation [update] said on August 6, 2007 6:49 PM:

PingBack from http://lifeparticles.com/2007/wiimote-used-in-xna-dev-presentation-update/

# ionous » Wii .NET said on August 7, 2007 9:28 AM:

PingBack from http://www.ionous.net/2007/08/07/wii-net/

# C#kes said on August 18, 2007 7:33 AM:

Can I use the new Apple USB Aluminium keyboard on Windows?

# StrafeRight - It's All About The D Key said on August 19, 2007 12:53 PM:

PingBack from http://www.straferight.com/forums/microsoft-console-systems/173295-article-xbox360-gaming-wiimote.html#post2449224

# All About Interop said on August 20, 2007 2:21 PM:

Just saw this, thought it was interesting in the realm of interop. The popular Nintendo Wii game system

# Noticias externas said on August 20, 2007 3:24 PM:

Just saw this, thought it was interesting in the realm of interop. The popular Nintendo Wii game system

# Abiyasa Blogs » Blog Archive » Portfolio Update said on August 20, 2007 4:27 PM:

PingBack from http://abiamy.com/abiyasablogs/2007/08/13/portfolio-update/

# WiiMoteLib « .Net/Mono ????????? said on August 21, 2007 10:42 AM:

PingBack from http://elleryq.wordpress.com/2007/08/21/wiimotelib/

# F??bio Pedrosa » Wiimotely Controlled Wee Little Rockets said on August 25, 2007 10:57 PM:

PingBack from http://www.fabiopedrosa.info/2007/08/26/wiimotely-controlled-wee-little-rockets/

# Dead Gamer » Blog Archive » Wii60 - Pillaged from OBsIV said on September 6, 2007 4:32 PM:

PingBack from http://deadgamer.com/?p=81

# neal said on September 15, 2007 9:10 AM:

Whre do u download the software for the computer to play drums...

i have a wii and a bluetooth-adapter

# Wiimote LED Serial Port Test — Wii Videos said on September 19, 2007 4:02 PM:

PingBack from http://wiivideos.info/wiimote-led-serial-port-test/

# Alvaro said on September 21, 2007 7:25 PM:

Hi, I'm mexican, i got a problem with wiimotelib, because the test program don't recognize the IRState, pleas help me!!!. Thanks

# Using Apple Aluminium Keyboard on Vista « Rick van de Laar said on October 6, 2007 4:52 PM:

PingBack from http://rickvandelaar.wordpress.com/2007/10/06/using-apple-aluminium-keyboard-on-vista/

# Coding4Fun said on October 18, 2007 7:06 AM:

In this article, Brian Peek will demonstrate how to use a Nintendo Wii Remote (Wiimote) as a controller

# Brian's Blog said on October 18, 2007 7:19 AM:

Long time no blog. My latest article is up at Coding4Fun . This time I created a Wiimote interface for

# Its A Trap » WiiEarth — Wiimote Interface for Virtual Earth said on October 18, 2007 8:11 AM:

PingBack from http://www.itsatrap.info/wiiearth-wiimote-interface-for-virtual-earth/

# Beth Massi - Sharing the goodness that is VB said on October 18, 2007 2:50 PM:

Check out this cool article on Coding4Fun that shows you how you can control the Wiimote (the Nintendo

# Noticias externas said on October 18, 2007 3:11 PM:

Check out this cool article on Coding4Fun that shows you how you can control the Wiimote (the Nintendo

# MSDN Blog Postings » Control Your Wiimote with Visual Basic said on October 18, 2007 3:58 PM:

PingBack from http://msdnrss.thecoderblogs.com/2007/10/18/control-your-wiimote-with-visual-basic/

# Clint Pearson said on October 19, 2007 3:12 PM:

hey... have you had any luck with the speaker yet? and also, with your library is it possible to write to the speaker using the instance(wiimote).Write() Method?

Contact me at clintsspace@hotmail.co.uk

# Brian's Blog said on October 22, 2007 6:58 AM:

Finally! I have updated my Wiimote library with quite a few bug fixes and a few new features. Here are

# Coding4Fun : Managed Library for Nintendo’s Wiimote · Nintendo Wii Zone said on October 26, 2007 2:58 AM:

PingBack from http://www.nintendowiizone.info/coding4fun-managed-library-for-nintendos-wiimote/2007/10/26/

# André Fiedler said on October 27, 2007 4:14 PM:

hi, can u include an autoconnect like this:

For i As Integer = 0 To devices.Length - 1

           If (devices(i).DeviceName.CompareTo("Nintendo RVL-CNT-01") = 0) Then 'If Found one

               If (devices(i).Connected) Then

                   AddConnectedDevice(devices(i))

               Else

                   UpdateStatus("Connecting to Wii Remote:" & devices(i).DeviceAddress.ToString)

                   If (devices(i).InstalledServices.Length = 0) Then      'If not installed its quick

                       devices(i).SetServiceState(BluetoothService.HumanInterfaceDevice, True) 'Should be connected now

                       AddConnectedDevice(devices(i))

                   Else    'If already installed, need to uninstall it then intall it again to get it to connect

                       UpdateStatus("Uninstalling Wii Remote:" & devices(i).DeviceAddress.ToString)

                       BluetoothSecurity.RemoveDevice(devices(i).DeviceAddress)

                       UpdateStatus("Connecting to Wii Remote:" & devices(i).DeviceAddress.ToString)

                       devices(i).SetServiceState(BluetoothService.HumanInterfaceDevice, True) 'Should Connect properly now

                       AddConnectedDevice(devices(i))

                   End If

               End If

           End If

           ' Non wii Devices here

       Next

This would be great! Cause im on vista and i have to install the wii mote again every time i will use it. :(

# cedric said on October 29, 2007 6:30 AM:

wow ! great ! what about creating a MSRS service to provide a wiimote interface for robotics :)

# André Fiedler said on November 1, 2007 3:36 PM:

how can i check if wii mote is connected? Like:

if(!myWiiMote.Connected) myWiiMote.Connect();

else myWiiMote.Disconnect();

ciao André

# juan antonio said on November 5, 2007 2:13 PM:

Hello, this is Juan Antonio, a telecomunication engineer student from Seville's University, in Spain.

I'm making my final career project. This is about using the Wiimote to different aplication, explaining the high capability of this device.

The main part is controling a Scorbot (a model of an academic manipulator robot) using the Wiimote. I have used your library so I would like to thank you your excellent work on it.

The next step was trying to incorporate the speaker funcionality that hasn't been added yet to your library. I have came to enable it and producing short or periodic sound using it, for example while pressing diferent buttons.

But the idea was to produce some record sound, for example a wave file. For example, imaging that you're controlling the robot, and you are moving it to some position. When the robot arrives, you can hear in the Wiimote's speaker: 'The robot has arrived'. This can be recorded in a .wav file.

In this way, i have added another class, WAVE CLASS, that opens the file, buffers it, and reads one piece of the buffer. The idea is that if a file has to be play, a flag is actived, and using a timer, speaker report by speaker report, filled with a piece of the wave file, is sent to the Wiimote.

It is very important to set the proper rate in the Wiimote, in the limits that Wiimote could, and the volume.

Although i have taken care of the rate and the speaker data format (i have tried the 8bitsPCM one) i haven't get good results.

I'm thinking that the problems is called Windows: Windows is the worst when we talk about real time (necesary in this case). Because i'm using the timer component, the problem is increased. It results in an strange noise which nobody can identify.

For that reason, I'm following periodically yor blog in order to test if you have added the speaker funcionallity.

Do you have the same problem? Have you get a solution?... Is the speaker funcionallity ready?

I wish you help me. Thank you very much,

Juan Antonio

# Coding4Fun said on November 15, 2007 11:47 AM:

@Oleg Deuschle:  I got a MSI bluetooth adapter and got it working.  I'd also suggest trying a newer version of the WiiMote lib from Brian.

# Create Digital Music » Free Wii Drum Machine for Windows Update, Plus Wii in .Net and Java said on November 15, 2007 11:48 PM:

PingBack from http://createdigitalmusic.com/2007/05/22/free-wii-drum-machine-for-windows-update-plus-wii-in-net-and-java/

# BrianPeek.com said on November 20, 2007 12:05 AM:

The following is a list of the applications that I know about using my .NET Managed Library for the Nintendo

# Brian Peek said on November 20, 2007 12:05 AM:

The following is a list of the applications that I know about using my .NET Managed Library for the Nintendo

# Bynario | wiimote SDK said on November 20, 2007 4:48 AM:

PingBack from http://www.bynario.com/20-11-2007/wiimote-sdk/

# Cedtat » WiiMote, C# … et Microsoft Robotics ? said on November 25, 2007 1:48 PM:

PingBack from http://cedric.tatangelo.com/?p=14

# Renato said on December 4, 2007 7:07 PM:

Great Job - thanxs thats funny to control my pc with the wiimote! now i try to cheat my wii ;)

# Coding4Fun said on December 5, 2007 8:29 PM:

If you're not sure what you need for this holiday season, look no further. After a year of coding and

# MSDN Blog Postings » Holiday Gift Guide - 2007 edition said on December 5, 2007 10:46 PM:

PingBack from http://msdnrss.thecoderblogs.com/2007/12/05/holiday-gift-guide-2007-edition/

# How to hack a mutltitouch display out of a Wiimote - Console Scene Forums said on December 10, 2007 2:43 PM:

PingBack from http://www.console-scene.info/forums/hacking-wii/279-how-hack-mutltitouch-display-out-wiimote.html#post558

# Tracking Your Fingers with the Wiimote - Console Scene Forums said on December 10, 2007 2:47 PM:

PingBack from http://www.console-scene.info/forums/hacking-wii/280-tracking-your-fingers-wiimote.html#post560

# TrackBack said on December 11, 2007 6:23 PM:

MultiTouch is everywhere. It's in the iPhone, it's

# Eric’s Corner » Blog Archive » Programming the Wii Remote said on December 11, 2007 8:09 PM:

PingBack from http://ericr.org/index.php/2007/12/11/programming-the-wii-remote/

# Christian Liensberger » Blog » Tracking Your Fingers with the Wiimote said on December 12, 2007 11:44 AM:

PingBack from http://www.liensberger.it/web/blog/?p=124

# Noticias externas said on December 13, 2007 5:23 PM:

Johnny Chung Lee has some awesome applications he's done with the WiiMote . He has two examples,

# Andemann said on December 15, 2007 3:55 PM:

Is able to pair the wiimote with my mac mini (booting win xp sp2) but it appears in the device list as not connected. Any suggestions for me?

Andreas

# MegaJiXiang said on December 17, 2007 9:13 PM:

I'd be careful about leaving your WiiMote installed laying around next to your computer.  Not doing anything at all it mannaged to suck out 50% of my battery.  I recommend uninstalling it or pulling out the batteries whenever you're done using it on the computer.

# Coding4Fun said on December 20, 2007 6:02 PM:

I couldn't get the one working on my MacBook Pro.  I ended up getting a MSI adapter.  The two wiki sites at the top of the article may be able to guide you better.

# Michael's Blog said on December 20, 2007 6:58 PM:

While writing my Silverlight wish list I found a very nice project. Johnny Ching Lee is using the controller

# Head Tracking for Desktop VR Displays - Console-Tribe.com Forum said on December 21, 2007 1:53 PM:

PingBack from http://forum.console-tribe.com/wii-official-homebrew-scene-news/t-head-tracking-desktop-vr-displays-48866.html#post448158

# rascunho » Blog Archive » links for 2007-12-20 said on December 21, 2007 3:56 PM:

PingBack from http://blog.bruno.locaweb.com.br/2007/12/20/links-for-2007-12-20/

# La Naturaleza del Software said on December 24, 2007 9:19 AM:

Les quiero presentar un par de innovaciones del investigador Johnny Chung Lee, postulante a doctorado en la Universidad de Carnegie Mellon. La primera innovación la descubrí a través de un post en Botón Turbo.. Lamentablemente en ese blog no entendieron..

# Manuales para torp.es said on December 26, 2007 7:05 AM:

PingBack from http://torp.es/?p=21

# La magia de innovar con la Wii - Est?s Limado said on December 26, 2007 10:18 AM:

PingBack from http://foro.estaslimado.com.ar/tecnologna-en-general/632-la-magia-de-innovar-con-la-wii.html#post18756

# :: MegaSonic :: Blog » La magia de innovar con la Wii said on December 26, 2007 10:59 AM:

PingBack from http://www.megasonic.com.ar/blog/2007/12/26/la-magia-de-innovar-con-la-wii/

# neoragex2002 said on December 31, 2007 5:39 PM:

http://www.wiili.org/index.php/Main_Page http://www.wiili.org/index.php/Wiimote http://wiibr...

# NeoRAGEx2002\’s Weblog » Blog Archive » Something about Wii, especially WiiMote said on December 31, 2007 7:44 PM:

PingBack from http://neoragex2002.wordpress.com.cn/2008/01/01/something-about-wii-especially-wiimote/

# Why Wiimoting is fun « Wiimoting said on January 3, 2008 12:25 AM:

PingBack from http://wiimoting.wordpress.com/2008/01/03/why-wiimoting-is-fun/

# Low-Cost Multi-point Interactive Whiteboards Using the Wiimote « Indigo`s Blog said on January 3, 2008 10:33 PM:

PingBack from http://chkzot.wordpress.com/2008/01/04/low-cost-multi-point-interactive-whiteboards-using-the-wiimote/

# Szymon Rozga’s Blog » Managed Library for the Wiimote said on January 4, 2008 1:07 AM:

PingBack from http://szymonrozga.com/blog/?p=13

# Rob’s Usability Development Blog: Silverlight, ASP.NET & Ajax » WiiMote Mania said on January 5, 2008 6:59 AM:

PingBack from http://www.robertjantuit.nl/?p=150

# Revolution??res idee in der Gaming Console said on January 6, 2008 7:37 AM:

PingBack from http://read.steuper.com/2008/01/06/revolutionares-idee-in-der-gaming-console/

# Mikon harrasteet » Blog Archive » Martzis USB HID Interface said on January 6, 2008 12:11 PM:

PingBack from http://martzis.wippiesblog.com/2008/01/06/martzis-usb-hid-interface/

# Mark S said on January 6, 2008 3:40 PM:

Excellent Library - thanks Brian. (Using Vista, .NET 2.0 and Dell XPS 1330 laptop with Dell Truemobile 355 + EDR and it works well) Found I have to completely remove the Wiimote as a device and reconnect from scratch after each run. Seems we need to close down the connection nicely somehow.

Interestingly, none of the other apps work (only the latest Library and test). Fine as I am playing with some of my own ideas - but would love to see what others have doen for real.

Awesome work Brian - many thanks !

# bcngeek, coding in Barcelona , a city of changes said on January 8, 2008 6:22 AM:

En el trabajo ya me empiezan a llamar el hombre de la wii, pero desde que descubrí la wiimotelib y ví

# Johnnylee_wii projects « In4Seasons said on January 9, 2008 10:27 AM:

PingBack from http://in4seasons.wordpress.com/2008/01/09/head-tracking_by-johnnylee/

# » Bookmark: Managed library for the Nintendo Wii remote said on January 11, 2008 1:22 AM:

PingBack from http://nintendowii.hotforbloging.com/2008/01/10/bookmark-managed-library-for-the-nintendo-wii-remote/

# BinaryJam » WPF, Minority Report style interaction said on January 14, 2008 5:10 AM:

PingBack from http://www.binaryjam.com/2008/01/14/wpf-minority-report-style-interaction/

# Martin said on January 14, 2008 9:51 AM:

Great work guys, I can't wait to get my hands on a wii-mote and start coding. So many ideas.

While sniffing the sourcecode i ran into the routine SetLEDs() in wiimote.vb and looked and the long if..then..else.. construction for an 8 bit value. The following line actualy does the same trick:

Mbuff(1) = CByte((led1 * 16 And 16) Or (led2 * 32 And 32) Or (led3 * 64 And 64) Or (led4 * 128 And 128)  Or GetRumbleBit())

# Nintendo Wii - Information on the Nintendo Wii » Bookmark: Managed library for the Nintendo Wii remote said on January 14, 2008 1:44 PM:

PingBack from http://nintendowii.2go5.net/?p=311

# Peter Bucher said on January 16, 2008 4:05 PM:

Johnny Chung Lee stellt auf seiner Webseite vor, wie er mit einer Wii Fernbedienung, einem Notebook mit

# Johnny Lee Projects - nintendowiis.net said on January 17, 2008 11:30 PM:

PingBack from http://nintendowiis.net/?p=29

# Nixarn said on January 19, 2008 7:44 AM:

I'm curious, why did the four IR signals get changed to only two with the latest version of the lib?

# Coding4Fun said on January 19, 2008 3:17 PM:

@Nixam

I assume you're referring to Johnny's lib.  He used my older v1.1 and added several things for his needs including IR3/4.  It has never been part of the official distribution, though it will be in the next version.

# Website Scripts » Coding4Fun : Managed Library for Nintendo’s Wiimote said on January 21, 2008 12:18 AM:

PingBack from http://websitescripts.247blogging.info/coding4fun-managed-library-for-nintendos-wiimote/

# Jayanth Nadig said on January 21, 2008 1:41 AM:

Hi,

I am trying to get MAC(Media Access Control) address of a mobile connected in Bluetooth network programmatically through C#.I am using

Visual Studio 2005. Please help me. Thanks in advance.

# Jose Luis Calvo said on January 21, 2008 3:50 PM:

Seems that Brian Peek put the seed on coding4fun , but the demonstrations from Johnny Lee are awesome.

# Noticias externas said on January 21, 2008 4:17 PM:

Seems that Brian Peek put the seed on coding4fun , but the demonstrations from Johnny Lee are awesome

# Coding4Fun said on January 22, 2008 9:28 AM:

@Jayanth: Did you try the Coding4Fun starter kit on CodePlex?

# Synesthesia » Links Roundup for 2008-01-16 said on January 22, 2008 9:28 AM:

PingBack from http://www.synesthesia.co.uk/blog/archives/2008/01/16/links-121/

# DeepVoid’s Log » Blog Archive » Head Tracking for Desktop VR Displays using the Wii Remote said on January 24, 2008 5:26 PM:

PingBack from http://www.deepvoidlog.com/2008/01/24/head-tracking-for-desktop-vr-displays-using-the-wii-remote/

# Jayanth Nadig said on January 25, 2008 5:26 AM:

@Coding4Fun...... i searched there.....but didn't get anything. if you have code please post it here........i am in need of that one. it's very urjent. plz plz post it if you have.

# Noticias externas said on January 25, 2008 3:11 PM:

Maker Faire 2008 is coming up fast and Coding4Fun was wondering what we should whip up. Comment or email

# Coding4Fun said on January 25, 2008 8:05 PM:

@Jayanth:  http://www.codeplex.com/C4FDevKit is currently the only bluetooth thing I know of without doing much research on the topic.

C4F Dev Kit to quote:  "Communication

Bluetooth – The Bluetooth controls and samples show you how to write applications that connect to and communicate with Bluetooth devices across several different Bluetooth profiles. "

# Primordial Ooze said on January 25, 2008 9:58 PM:

If you want to see some amazing projects that utilize the Nintendo Wiimotes, check out http://www.cs.cmu.edu/~johnny/projects/wii/. The demo that inspired me to write about this at all was, hands down, “Head Tracking for Desktop VR Displays using

# Primordial Ooze said on January 25, 2008 10:03 PM:

If you want to see some amazing projects that utilize the Nintendo Wiimotes, check out http://www.cs.cmu.edu/~johnny/projects/wii/. The demo that inspired me to write about this at all was, hands down, “Head Tracking for Desktop VR Displays using

# Primordial Ooze said on January 25, 2008 10:05 PM:

If you want to see some amazing projects that utilize the Nintendo Wiimotes, check out http://www.cs.cmu.edu/~johnny/projects/wii/. The demo that inspired me to write about this at all was, hands down, “Head Tracking for Desktop VR Displays using

# Designer WPF » Blog Archive » WPF Multi-Point Tutorials, Part 1: Connecting the Wiimote Controller said on January 29, 2008 1:51 AM:

PingBack from http://www.designerwpf.com/2008/01/28/wpf-multi-point-tutorials-part-1-connecting-the-wiimote-controller/

# BrianPeek.com said on January 29, 2008 12:29 PM:

I have updated the Managed Wiimote Library on CodePlex to version 1.2.1 by adding support for IR3 and

# Brian Peek said on January 29, 2008 12:29 PM:

I have updated the Managed Wiimote Library on CodePlex to version 1.2.1 by adding support for IR3 and

# Virtual Hosting Blog » How to Homebrew Wii Games: 73 Tips, Tutorials and Resources said on January 29, 2008 12:51 PM:

PingBack from http://www.virtualhosting.com/blog/2008/how-to-homebrew-wii-games-73-tips-tutorials-and-resources/

# Designer WPF » Blog Archive » WPF Wii Multi-Point Tutorials, Part 2: Writing a Code-less Wiimote Program said on January 31, 2008 4:12 AM:

PingBack from http://www.designerwpf.com/2008/01/31/wpf-wii-multi-point-tutorials-part-2-writing-a-code-less-wiimote-program/

# Mattiesworld » Blog Archive » Wiimote fun said on January 31, 2008 5:05 PM:

PingBack from http://mattiesworld.gotdns.org/weblog/2008/01/31/wiimote-fun/

# BrianPeek.com said on February 1, 2008 3:09 AM:

For those of you that use my Managed Wiimote Library (and if you're not, why aren't you?), I've put together

# El Bruno said on February 1, 2008 4:11 PM:

Buenas algunas personas no lo saben pero durante mucho tiempo, el proyecto creado por Brian Peek para

# El Bruno said on February 1, 2008 4:11 PM:

Buenas algunas personas no lo saben pero durante mucho tiempo, el proyecto creado por Brian Peek para

# El Bruno said on February 1, 2008 4:11 PM:

Buenas algunas personas no lo saben pero durante mucho tiempo, el proyecto creado por Brian Peek para

# Marketing & Strategy Innovation Blog said on February 2, 2008 5:59 AM:

by: Amy S. Quinn (guest blogger)Certainly you've heard that fully integrated Wii homebrews are in the near future, but did you know that developers are already homebrewing for the Wii? Through the Internet Channel, you can play Flash and Javascript..

# SesoLibre.com » Blog Archive » Pizarra electr??nica de Bajo-Costo usando el Wiimote said on February 5, 2008 9:42 PM:

PingBack from http://sesolibre.com/?p=574

# Links (8) » Hay Kranen said on February 15, 2008 8:56 AM:

PingBack from http://www.haykranen.nl/2008/02/15/links-8/

# Abhiram said on February 17, 2008 12:54 PM:

Just wanted to know if it's possible to develop applications with a simulated wiimote. I know we can map the keyboard to the wiimote using the GlovePIE utility, if only we can make windows think there's a wiimote connected to it.

Any ideas? The reason I ask is because I don't have my wiimote with me at the moment, but would be nice if I could get my hands dirty with some of this stuff until I get my hands on it.

# Embedded Windows Team (NT4e, XPe, Vista Embedded) said on February 18, 2008 1:55 PM:

How often do you get an e-mail where somebody says "this is cool" and provides a link to a web site or

# MSDN Blog Postings » Head Tracking using a Wii Remote said on February 18, 2008 2:38 PM:

PingBack from http://msdnrss.thecoderblogs.com/2008/02/18/head-tracking-using-a-wii-remote-2/

# MSDN Blog Postings » Head Tracking using a Wii Remote said on February 18, 2008 2:38 PM:

PingBack from http://msdnrss.thecoderblogs.com/2008/02/18/head-tracking-using-a-wii-remote-3/

# MSDN Blog Postings » Head Tracking using a Wii Remote said on February 18, 2008 2:38 PM:

PingBack from http://msdnrss.thecoderblogs.com/2008/02/18/head-tracking-using-a-wii-remote-4/

# Noticias externas said on February 18, 2008 2:46 PM:

How often do you get an e-mail where somebody says "this is cool" and provides a link to a

# Wiimote Control « Open Sourcery said on February 20, 2008 4:37 PM:

PingBack from http://opensourcery.wordpress.com/2008/02/20/wiimote-control/

# tim said on February 22, 2008 12:36 PM:

I can't read from the nunchuck. If I disconnect it and reconnect, I can't read anything, if I add a call to getBatteryLevel I get an error asking if the wiimote is connected when it is.

# Conseguir una pantalla t?ctil con poco.. - MTFxP GrouP - MioTraGus TeaM said on February 23, 2008 10:45 PM:

PingBack from http://foro.miotragus.org/12-hardware-en-general/conseguir-una-pantalla-tactil-con-poco-12712/#post48357

# andrè said on February 28, 2008 4:10 PM:

can someone tell me more about ir state....

why there are for data???

x1,x2,x3,x4 ???

thanks very much...

# Finger tracking con Wiimote e la sua webcam ad infrarossi integrata | Urban.Blog ?? web, design, multimedia, interaction said on February 29, 2008 9:22 PM:

PingBack from http://www.urbangap.it/blog/index.php/2008-03-finger-tracking-con-wiimote-e-la-sua-webcam-ad-infrarossi-integrata/

# Coding4Fun said on March 3, 2008 7:53 PM:

@andrè:  The wiimote can track up to four IR sources.  Johnny Lee added in support for the last 2, Brian Peek did the first 2.

# Doran said on March 4, 2008 10:04 AM:

Can anyone tell me if it is possible to connect more than one wii to the lib with vb?

# Ulises said on March 7, 2008 10:29 PM:

HI I´m new on Csharp,  i´ve made come basic games on XNA ind i like to use my wiimote on them.

I´ve run the aplication test contained on the wiimote.zip library. I like that you bring me and complete example using the wiimote. Thank you and see you

# Coding4Fun said on March 13, 2008 5:39 PM:

@Ulises:  You can use it just like a normal controller.

http://www.kudzuworld.com/blogs/Tech/20070731.en.aspx

# Desktop Computers » Coding4Fun : Managed Library for Nintendo’s Wiimote said on March 19, 2008 12:58 AM:

PingBack from http://desktopcomputerreviewsblog.info/coding4fun-managed-library-for-nintendos-wiimote/

# » Johnny Lee on MultiTouch with Wii said on March 29, 2008 3:55 AM:

PingBack from http://uiui.mmdays.com/2008/03/29/johnny-lee/

# Mista Man said on April 6, 2008 5:51 AM:

Where can i find the source code?

# Coding4Fun said on April 6, 2008 2:52 PM:

Link is at the top of the article where it says "Download"

You can get the source on CodePlex

# Ben said on April 9, 2008 9:57 AM:

Will there be support for multiple wiimotes? (2-4)?

# Coding4Fun said on April 9, 2008 12:36 PM:

@Ben:  Looks like Brian Peek has it in the pipeline to add in that feature but it is currently TBD.

http://www.brianpeek.com/forums/t/802.aspx

http://www.codeplex.com/WiimoteLib

# Wii Rules said on April 18, 2008 6:49 PM:

Are there any docs for using this library in BDS2006 - delphi compiler ?

# Richard said on May 12, 2008 11:11 PM:

Do you know if there will be any legal issues if i use your library or one of the similar one and develop some commerical software which uses the wii remote?

# Coding4Fun said on May 16, 2008 3:45 PM:

@Richard:  Brian has it under the Ms-PL license.

http://www.codeplex.com/WiimoteLib/license

From CodeProject:  http://www.codeproject.com/info/Licenses.aspx

Provides copyright protection: True

Can be used in commercial applications: True

Bug fixes / extensions must be released to the public domain: False

Provides an explicit patent license: True

Can be used in closed source applications: True

Is a viral licence: False

# Christian said on May 23, 2008 1:10 AM:

Hi, I'd like to ask if someone could help me , I would like to access accelerometer reading of the Wiimote. I am not a computer expert. Can somebody help out in giving me a step by step acoutn on how to do this? Thanks a lot!

# Evan said on May 24, 2008 12:28 AM:

Will this erase all the original data on the wii remote to were i will not be able to use it for the wii?

# Coding4Fun said on May 24, 2008 3:35 AM:

@Evan:  It should not, just mounts it as a bluetooth input device.

# Coding4Fun said on May 24, 2008 3:36 AM:

@Christian:  This API does just that, The demo app will show you how to get back the data.  If you want to see how Brian actually gets the data out, the wrapper is open source.

# Steve said on May 26, 2008 8:25 AM:

Hi, I have a question. I can connect two or more wii mote to pc?

What must change in the code???

Thanks

# Coding4Fun said on May 30, 2008 9:11 PM:

@Steve:  Have you tried to connect 2?

# Steve said on June 1, 2008 6:37 PM:

yes i have try to connect 4 wiimote whit a function that return a list of wiimotes.

In the form I have duplicate the handler function new WiimoteChangedEventHandler(wm_WiimoteChanged#);

new WiimoteExtensionChangedEventHandler(wm_WiimoteExtensionChanged#);

where # is wiimote that i control.

But when i run the program it stay loading...

Whit two wiimotes work.

Help??

Thanks

# Coding4Fun said on June 2, 2008 7:45 PM:

@Steve:  Contact me via the email link at the top right of the page.

# frantrax said on June 4, 2008 11:33 AM:

I have one question about de Wiimote's API. Can it use with commercial purpose?

I want to say if some enterprise use this API for develop something related with the wiimote like a game, if is posible to sell it to anorther enterprise.

I haven't find the license of this API.

thanks

# BrianPeek.com said on June 7, 2008 4:03 PM:

Download the latest version Coding4Fun article Support forums Spify applications using WiimoteLib

# The Tomes Of Experience » Head-Tracking for Virtual 3D Audio Environments - Part 1 (Research) said on June 16, 2008 6:50 AM:

PingBack from http://www.xerxesb.com/2008/head-tracking-for-virtual-3d-audio-environments-part-1-research/

# Bespoke Software » Wiimote Gesture Recognition said on June 28, 2008 7:51 PM:

PingBack from http://www.bespokesoftware.org/wordpress/?p=33

# MagnusLab - » Gestire il wiimote con C# said on July 2, 2008 5:41 AM:

PingBack from http://www.magnuslab.it/2008/07/02/gestire-il-wiimote-con-c/

# BermudaLamb said on July 10, 2008 10:07 PM:

Why does it seem like I have to go through the pairing everytime with the Wiimote.  If I turn it off I can it disconnect from my Bluetooth devices.  But when I turn it back on there is no reconnect.  If I run the sample I get the message box about no Wiimote found in the HID Device list.

# Gary said on July 12, 2008 10:19 AM:

Hello, does any know where you stand from a legal point of view for developing software on the PC for use with the Nintendo Wii controllers, especially if the software is a subscription or paid for to the end user? I want to setup commercial/fun software using the fantastic Wii controllers and the Wii Balance Board but im unsure of how Nintendo would react with someone selling software to use with their patented/copyrighted/trademarked etc. etc. controllers??

# Coding4Fun said on July 14, 2008 6:15 PM:

@Gary:  DISCLAIMER:  I am not a lawyer.  The EULA that comes with the controller should say if this would be deemed an abuse of their end user agreement.

With that said, my view point is their controller is just a tool.  I view it like using an Xbox controller with a computer, it works, why not use it.  The controller is a nice, off the shelf solution that does some really neat stuff.

They earn money from the sale of the controller, and none of their code has been reverse engineered or stolen.  People have released applications using the controller, and to my knowledge, nothing bad has happened.  With that said, I don’t know of anyone that has SOLD software that requires it.

My suggestion is read the EULA.

# phan said on July 22, 2008 3:16 AM:

hi i want to ask about the data given by the 'accelstate' in the source code.i see in the given example WiimoteTest.exe the data from accelstate is changing very fast..what is the sampling time for get that data?it is get the data every seconds or what??thx...

# Ralph Hulslander said on July 24, 2008 1:14 PM:

I am brand new to all of this, but I have a WIImote and Balance Board.

I can discover the WIImote and Balance Board in Bluetooth Neighborhood but I do not seem to be able to connect. There is no Pairing.

I am using a ZOOM PC Card Model 4312 what is a recommended Bluetooth device for my PC?

What works? Probable would prefer a USB device but PC Card is fine.

Thank you,

Ralph

# Coding4Fun said on July 24, 2008 1:24 PM:

@Ralph Hulslander:  Connecting the device is described in the article.  "Getting Connected" is the sections title.  Per good bluetooth dongles, check out one of the wiki's that are in the section above "Getting Connected".

# Gustavo said on July 28, 2008 3:02 PM:

Hi! I'd like to know what is the best and most new program/driver to use the wiimote as joypad?

Thank you!

# john said on September 1, 2008 4:46 AM:

Hi!....i read this article and i liked it very much....i hav basic knowledge of C# but i wasnt able to understand the code....what should i learn so that i understand this code.....

# Coding4Fun said on September 5, 2008 1:01 PM:

the article is aimed at teaching you how to interface with an object such as the wiimote.

# Soham said on September 12, 2008 7:27 AM:

Hello! I wuld like to write data to the wiimote extension adress(0x04a40001), to which i have connected an arduino. could you tell me how i can use your library to do this?

soham

# MARTIN said on September 13, 2008 5:39 PM:

Why cant use the sound in the wiimoteLIb?

FATAL ERROR

# Mark said on September 24, 2008 8:41 AM:

I have the module from Microsoft to connect wireless Xbox controllers to my pc, can i use that to connect a Wiimote as well?

# How to create Low-Cost Multi-touch Whiteboard using the Wii Remote said on September 24, 2008 12:01 PM:

PingBack from http://www.technospot.net/blogs/how-to-create-low-cost-multi-touch-whiteboard/

# Coding4Fun said on September 25, 2008 6:17 PM:

@Mark, your computer will need bluetooth adapter, the wireless xbox controller isn't a bluetooth adapter.  Your computer may have one built in.

# Marcin said on September 25, 2008 9:26 PM:

Hi, I am very interested in using your library (I am actually working on a fourth year engineering thesis and want to implement this library into the project), but I am not very familiar with C#. Is there any way I can call the .dll in C++ or some other way to get this library to work with C++?  

Thanks

# Coding4Fun said on September 28, 2008 7:12 PM:

@Marcin:  Managed to unmanaged or managed to managed code?

# Steve said on October 9, 2008 9:16 AM:

Hi, i maling a system to 6dof tracking. I must view only 3 marker and i want disable the wiimote tracking of another source for the noise problem. Can I?

# Pedro Neto said on October 13, 2008 2:29 PM:

Hi, I made my own code to extract motion data from the Wii Remote and use that information to control an industrial robot. You can see the video: <a href="http://www.youtube.com/user/RoboticsTime">RoboticsTime</a>.

But now, I saw that the WiimoteLib offer the possibility to extract data from the Nunchuk, and my next job will be control the robot with the Nunchuk.

Thanks

# Smokie said on October 14, 2008 1:03 PM:

Cool idea this library. For the smokers uf us...it also works with a burning cigarette than a ir pen 8-) but don't forget: smoking kills

# How Do I Completely Format My Macbook Pro &diams; Apple MacBook and MacBook Pro News said on October 17, 2008 3:31 PM:

[...] an interesting post was made today on this site [...]...

# Digital Wall &laquo; No Free Time said on November 6, 2008 4:48 AM:

PingBack from http://andrewmyhre.wordpress.com/2008/11/06/digital-wall/

# Using your Wiimote on the Xbox360 How to: &laquo; VettaCossX&#8217;s Console Hacking Site said on November 10, 2008 3:52 PM:

PingBack from http://vettacossx.wordpress.com/2008/11/11/using-your-wiimote-on-the-xbox360-how-to/

# Coding4Fun said on November 14, 2008 3:58 AM:

In this article, Brian Peek will demonstrate how to use a Nintendo Wii Remote (Wiimote) and Vuzix VR920

# Head tracking usando un wiimote &laquo; realidad++ said on November 24, 2008 7:59 PM:

PingBack from http://rudiaherpfc.wordpress.com/2008/11/25/head-tracking-usando-un-wiimote/

# Tony J. said on December 2, 2008 1:03 PM:

Brian this is some great stuff! Thank you very much for all your work. I am using your library now (and some of the WiimoteTest code, modified) in a little C# .NET application that records Wii remote motion along each axis while the B and/or A buttons are held down. It displays the acceleration in a little graph. That way you can graph a short motion (like swinging in Wii Sports Bowling), and practice copying that motion over and over... perfecting the same exact swing. Once I'm finished I'll provide a link, and definitely credit you for this very useful library!

# Wii Drum High &raquo; Developages - Development and Technology Blog said on December 4, 2008 12:28 AM:

PingBack from http://www.developages.com/wii-drum-high/49734

# Utilizando el Wiimote con C# | Jorge Iv??n Meza Mart??nez said on December 11, 2008 10:34 AM:

PingBack from http://www.jorgeivanmeza.com/blog/2008/12/11/utilizando-el-wiimote-con-csharp/

Leave a Comment

(required)
(optional)
(required)
Page view tracker