LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a wiimote with LabVIEW

I'm using the wiimote vi available here: http://decibel.ni.com/content/docs/DOC-1353

 

I seem to get about 10 acceleration samples/values per second. Anyone know if that's standard and what might be affecting my sampling frequency? I'd prefer it to be closer to 100 samples/second in order to record accelerations I am interested in.

 

Thanks,

 

-Adam 

0 Kudos
Message 61 of 220
(6,723 Views)

Adam,

 

I looked at that code several months back and decided that it was a bit outdated for my liking.  I went ahead and created my own little API/library that uses version 1.5.2.0 of the WiimoteLib.dll.  I created a quick example VI that will connect to the Wiimote, perform your accelerometer readings in a while loop, then exit and close references.  I'm working on my own version of the LabVIEW WiiMote API using the WiimoteLib and .NET.  I wasn't as big of a fan as the event based measurements as it was a little more confusing.  Using straight invoke/property nodes one can achieve similar results but it is much easier to create a SubVI for each type of function you'd like.

 

Let me know if running this VI with the 1.5.2.0 DLL increases performance.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
Message 62 of 220
(6,690 Views)

That sounds like just what I need. I have Labview 8.5 though... Could you post or send me a version for 8.5?

 

Thanks!

 

-Adam 

0 Kudos
Message 63 of 220
(6,665 Views)

Adam,

 

Please see the attached file.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
Message 64 of 220
(6,639 Views)

Thanks.

 

It is about 20 X faster and more stable in terms of sampling frequency etc.

 

-Adam 

0 Kudos
Message 65 of 220
(6,622 Views)

Adam,

 

That is great news!  I might invest some time in finishing this WiiMote Library that I started a while back and make it available online - sounds like there might be some interest in it.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
0 Kudos
Message 66 of 220
(6,587 Views)

The example that I had posted here: http://decibel.ni.com/content/docs/DOC-1353 actually includes several different examples, one that uses an event-driven approach and one that uses a more simple acquire-in-a loop approach. The latter framework opens a reference outside of the loop and calls a subVI in the loop for each measurement.

 

In playing with my code, I found that the speed of the acquisition appeared to be limited to the rate as supplied by the underlying WiimoteLib DLL.

 

--Sam

Sam Shearman
0 Kudos
Message 67 of 220
(6,550 Views)
I used that example to get me started, but then noticed that there was a newer version of the DLL (which had more Wii controllers - including the balance board).  However, the calls to the new DLL didn't transfer over very well, this is the main reason I created my own.  The one you are referencing is where I started.  It looks like the DLL is now version 1.6 so mine probably needs updating as well.  There have been several bug fixes along the way with the WiimoteLib, the newest version might be even faster.
Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
0 Kudos
Message 68 of 220
(6,507 Views)

Anyone know if the vis work or if anyone has gotten them to work with the nunchuck?

 

Thanks,

 

-Adam 

0 Kudos
Message 69 of 220
(6,440 Views)

Adam,

 

I don't remember if the ones on the dev zone worked or not with the nunchuck.  Sometimes you need to once the Wiimote is connected to your program, disconnect (physically) the nunchuck from the Wiimote and then plug it back in.  I've written code that works with the nunchuck (xy coordinates, buttons, and accelerometers) with the 1.5.2 version of the library.  If you'd like that I could probably whip up something, what are you wanting to gather?

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
0 Kudos
Message 70 of 220
(6,398 Views)