LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a wiimote with LabVIEW

After seeing many movies on the internet of people controlling random devices (eg. roomba) with a Wiimote, I wanted to play too. We wrote a set of LabVIEW VIs to configure and query the wiimote. The VIs call into the Microsoft Windows Bluetooth stack and communicate via a set of proprietary input and output reports. Most of the information regarding the proprietary report formats was obtained from the following sites:

WiiBrew Wiki

WiiLi

The Wiimote VIs currently can:
* Read and write LED status
* Read all buttons (except power button)
* Read calibrated accelaration data
* Read up to 4 IR sources

There is still some functionality missing:
* Nunchuk is not supported yet
* Speaker is not supported yet

The minimum requirements (as tested) for using the VIs are:
* Microsoft Windows XP SP2
* Cambridge Silicon Bluetooth Radio (other Bluetooth stacks may work as well)
* LabVIEW 8.2
* Wiimote controller
* IR Source for tracking IR data


These VIs are a work in progress, and I hope to add more features and examples in the future.

Hope this helps,

JohannS

PS Now go shake a wiimote at LabVIEW

Message Edited by JohannS on 05-25-2007 07:59 AM

Message 1 of 220
(60,471 Views)
Here is an update to the existing Wiimote VIs.

Changes:
* Added support for Nunchuk extension controller.
* Updated VIs to allow multiple wiimotes to be used simultaneously.
* Updated examples.
Message 2 of 220
(60,361 Views)
JohannS-

I've been using the Wiimote VI's for a while now and love them. Excellent, clean interface. Thanks for all the hard work.

Xaq
0 Kudos
Message 3 of 220
(60,208 Views)
Is the source for your dll available?  We would like to use a PDA as a bluetooth server for a wiimote and serial to bluetooth adpater on a microcontroller.  We would need to recompile the dll for use on windows CE.

David

Message Edited by David.Collins on 05-30-2007 01:28 PM

0 Kudos
Message 4 of 220
(60,162 Views)
I've been wanting to play around with this. I have a Wii and bluetooth adapter, and as soon as people started doing this on thier computers I wanted to do it in LabVIEW, I just never got around to it. It's good to see someone else had the same idea, so I may have to give these VIs a try.
0 Kudos
Message 5 of 220
(60,142 Views)

Hi JohannS

Thank you for the wonderfull App, works great, but want vibration support, are there any plans of implimenting vibration feed back??

 

Thank you in advance

Dj

0 Kudos
Message 6 of 220
(59,710 Views)
Dj

My ultimate goal is to have an easy to use set of VIs that expose the functionality of the Nintendo Wiimote.

I have considered adding support for the rumble feature. It would be a single VI, probably called Wiimote Set Rumble.vi, that turns the rumble feature on or off. Unfortunately there are some undesired interaction with the other functions. The rumble state is updated by any output report sent from the host to the wiimote. If you dig into the code, you will see that we use Wiimote Set Output Report.vi all over the place. So the problems are:

1) Turning rumble on/off would disable any previously set LEDs
2) Calling any Wiimote VI that sets an output report would disable the rumble if it has been enabled.

So I am left with following options:

1) Implement a single VI that enables/disables the rumble, knowing that it would be immediately be disabled once I call any other Wiimote VI that sets an output report.
2) Add a rumble input to each VI which sets an output report in the API so that the rumble state is maintained even if calling other Wiimote VIs.
3) Add rumble state information to the Wiimote session. Use session state whenever setting output report to maintain rumble state. This would become slightly trickier when using multiple wiimotes in the same application.
4) Do not support rumble feature for now.

So I would like to ask you a question (or two).
a) Would you mind if the rumble feature is automatically turned off if you call any other Wiimote VI?
b) Would you prefer that the rumble state is maintained even if you call other Wiimote VIs?

Thanks,

JohannS
0 Kudos
Message 7 of 220
(59,691 Views)

Hi Johanns

 

Thank you very much for the reply, i do not mind those issues at the moment, i need implement the rumble due to the feedback, please let me know how to go about it at the moment

Thanks/Regards

Dj

0 Kudos
Message 8 of 220
(59,686 Views)
Dj

Try the attached VI. Its quick and dirty. It turns the Rumble on and off. Like discussed in my previous post, the rumble will be disabled if you call any VI that internally calls Wiimote Set Output Report.vi.

Hope this helps,

JohannS
0 Kudos
Message 9 of 220
(59,678 Views)

Thank you very much Johanns, I really appreciate your help, meanwhile i was looking at the wiki of wii, you can control the rumble even with code 0x13, & sending 0x01 or 0x00 for set/reset respective. Any ways i shall try in the morning, Thank you again

Regards

Dj

0 Kudos
Message 10 of 220
(59,670 Views)