NI Home
Cart Cart | Help
Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Currently Being Moderated

LabVIEW interface to a Wii Remote ("Wiimote")

VERSION 28

Created on: Feb 12, 2008 2:33 PM by Sam Shearman - Last Modified:  Dec 7, 2009 1:51 PM by Deirdre

 

With a high-resolution camera, a 3-axis accelerometer, buttons, speaker, LEDs, vibration feedback, and a Bluetooth wireless link, the Nintendo Wii Remote Controller ("Wiimote") offers exciting possibilities beyond use as a video game controller for the Nintendo Wii video game console. With the examples in this document, you can easily access these data sources in NI LabVIEW.

The attached zip file includes a LabVIEW project with examples that show how you can access a Wiimote with LabVIEW.

Getting Started

  1. Download and Unzip the attached file into a new folder.
  2. IMPORTANT: These examples rely on a third party .NET Managed Library called “WiimoteLib” to establish the link. This library is freely downloadable from this site: http://www.codeplex.com/WiimoteLib. Download the version of WiimoteLib that corresponds to the version of the attachment that you downloaded (see table above). Ensure that the dll ("WiimoteLib.dll") from the managed library is in the same folder as the files that you unzipped.
  3. IMPORTANT: Establish a Bluetooth link "pair" with the Wii controller and your PC. The specific instructions for doing so will depend on the specifics of your Bluetooth software / hardware. (I found some instructions for how to do so in the "Getting Connected" section of this article.)
  4. Open the LabVIEW project file WiimoteExamples.lvproj in LabVIEW and access the examples from the project explorer window.
  5. If you are new to LabVIEW, start with the examples Simple Flash LEDs (Polled).vi and Simple Acquisition (Polled).vi. These contain the simplest LabVIEW programming of the example set. The Simple Acquisition (Polled).vi example polls for new data (accelerometer data and button status) from the Wiimote within a loop.
  6. The example Roll Pitch (Event).vi contains more involved LabVIEW programming, but is a more efficient implementation that relies on event callbacks to acquire the Wiimote state.  The example registers a callback VI to acquire accelerometer data and button status from the Wiimote as it is available. It's more involved than the polling in a loop method of the Simple Polled Acquisition.vi example, but it's more efficient and returns events as they occur.
  7. The example Acquisition + IR (Event).vi registers a callback VI to acquire accelerometer data, button status, and IR camera data from the Wiimote as it is available. Uses a picture control “IR Camera” to display the location of the IR sources from the IR flashlight bar.  The IR Camera display will be blank unless Wiimote is pointed at a pair of valid IR sources (such as those from the IR flashlight bar).
  8. For LabVIEW programming help, be sure to see the comments found on the block diagrams.
  9. Have fun.

Wish List

  • In an ideal world, with infinite time to code for fun I might address the following. Lacking infinite time, I’ll present these as ideas for future development…
  • The current code returns basic X, Y, Z acceleration values and some simple trig is applied to convert these values to roll and pitch. The conversion routine isn’t ideal and has at least a few problems. For instance, it jumps to incorrect orientation when the Wiimote is rotated more than 180 degrees on one axis. Another issue is that one axis will lose precision when a related axis is tilted close to an extreme.
  • Apply data from the accelerometers and the IR camera for better absolute position measurement
  • Interface with the WiiMotionPlus
  • Analyze the accelerometer / IR data to identify “gestures”—patterns of motion.
  • Access the vibration feedback output of the Wiimote
  • Access the sound output of the Wiimote
  • Access data from a Nunchuck connected to your Wiimote
  • Access data from Drums / Guitar controller

 

Note

This thread includes discussion related to the example code posted here and also references another LabVIEW to Wiimote interface example.http://forums.ni.com/ni/board/message?board.id=170&thread.id=249428&view=by_date _ascending&page=1

Release Notes

6/4/2009

  • Filename: WiimoteManaged(wml17).zip
  • Removed Older 1.5.2
  • Examples more consistently named, revised documentation
  • Added example showing how flash the LEDs

3/11/2009

  • Filename: WiimoteManaged(wml17).zip
  • Relies on WiimoteLib Ver 1.7
  • Examples more consistently named
  • Added example showing how to access multiple Wiimotes
  • Added example showing how to access data from a Nintendo Balance Board. (Note that this support is untested, as I don’t actually own or have access to a balance board!)

 

Initial release (8/2008)

  • Filename: WiimoteManaged(wml152).zip
  • Relies on WiimoteLib Ver 1.5.2

 

Downloads:
Average User Rating
(4 ratings)




nighthawk0501 nighthawk0501  says:

Additional Wii-mote developments can be found here;

www.cs.cmu.edu/~johnny/projects/wii/

Jakub Czaplicki Jakub Czaplicki  says:

Is there any chance of having version for LV 8.2 ?

po0 po0  says:

there is a problem with the IR data acquisition rate both for Polling and Event driving methods.  The acquisition rate drop from 100Hz down to 20 Hz in few minutes. I have tried different bluetooth adapters and no help. Please help why the acquisition rate drop and any solution?

Sam Shearman Sam Shearman  says in response to po0:

Haven't seen this problem. My first thought would be that it is related to the Bluetooth driver software that you are using. I know you mentioned that you had tried different bluetooth adaptors, but did you also try different bluetooth driver software e.g. Bluesoleil versus Microsoft built in?

 

My experience has been that adaptors that work with the BlueSoleil bluetooth driver  software seem to be the most robust.

More Like This

  • Retrieving data ...

More by Sam Shearman