LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a wiimote with LabVIEW

Does the analog stick on the nunchuck work as a potentiometer? Sending different voltages out based on the position of the controller?

 

It's kindof complicated, but along with acceleration data from the wiimote, I need to wirelessly transmit an oscillating voltage which corresponds to pulse data from a pulse meter. 

 

I thought that I might be able to open up the nunchuck and replace the analog stick with leads from the pulse meter. Then this data could be transmitted via bluetooth to a computer running the wiimote VI and it would look like the analog stick was being cycled up/down. 

 

From that we could calculate the pulse rate of a subject in beats per minute. This is why I was hoping to get a VI with the ability to access and graph the nunchuck analog stick data.

 

0 Kudos
Message 71 of 220
(5,695 Views)

Adam,

 

It looks like nobody is replying to this discussion forum.  I happened to stumble upon this again and have come up with a solution for you.  See the files in the attached zip.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
0 Kudos
Message 72 of 220
(5,524 Views)

Adam,

 

If you get this working, could you determine what the analog voltage input range and is it bipolar ?  Any idea what the resolution of the adc is (# of bits) or what the smallest change in your measured voltage is that produces a change in the X or Y values ?  What about noise - is there fluctuation in the X or Y values when the joystick position/voltage is constant ?

 

Thanks,

Steve

 

0 Kudos
Message 73 of 220
(5,520 Views)

I recently pieced together all of the VIs for the Wiimote in LabVIEW, by the way very cool! I am having problems with the set output report VI. When I try to run the entire VI set, a dialogue box comes up and says: 

 

Error -1 occurred at Wiimote Set Output Report.vi 

This error code is undefined. No one has provided a description for this code, or might have wired a

number that is not an error code to the error code input. 

 

Can anyone help me solve this please?

Message Edited by Curv3Th3Bu113t on 03-03-2009 09:08 PM
0 Kudos
Message 74 of 220
(5,337 Views)

One reason for that error (and potentially not the only reason) is that your Wiimote hasn't been paired with your bluetooth interface--you have to do that prior to running the LabVIEW code.

 

--Sam

Sam Shearman
0 Kudos
Message 75 of 220
(5,315 Views)

Hi,

Nice project ! I hope to get it going and use it soon ...

 

Currently I'm trying to get the Event Callback (IR).vi example working for 2 wiimote's. It does work more or less, but the events have considerable timedelay. The original example (which doesn't use the collection) does not show this. Also with the original (C#) example from codeplex.com, which uses the same lib, this is not the case. For as far as I can see, the .net calls are similar between the c# and labview examples.

 

Is this a labview .net issue or is there something I forget ?

Or do you have a working example of this in another (HID) way ?

 

Thanks for any help,

Peter

 

0 Kudos
Message 76 of 220
(5,175 Views)

Hi Peter,

 

I only had time to put together the one  example using the Wiimote collection: Polled Acquisition (MultiWiimote).vi

 

I haven't tried the callback approach with multiple wiimotes, so I'm not sure where the problem might be coming up.

 

The Polled Acquisition (MultiWiimote).vi example is included in the zip file and part of the project.

 

Are you seeing any delay when you run that example? I don't see any delay for that, at least with my setup.

 

--Sam

Sam Shearman
0 Kudos
Message 77 of 220
(5,158 Views)

No Sam,

No visible delay's for Polled Acquisition (MultiWiimote).vi, if I lower the loop time to 10 msec. Also no errors if I shut down labview and start it up again.

But if I run Event Callback (IR).vi as is and shutdown labview I get this error while starting up again :

 

"The last time you ran LabVIEW, an internal error or crash occurred at vientrypoint.cpp, line 157"

 

Actually I did send the error report to NI, I wonder if this might have to do with a combination of .net and events in labview ?

Maybe it points to the problem I have when combining above 2 examples.

 

Peter

0 Kudos
Message 78 of 220
(5,110 Views)
Do you get this same cpp error every time you run the program?
0 Kudos
Message 79 of 220
(5,069 Views)

Yes.

Every time I run the example with events, I don't see errors but the next time I start labview I get the same error message.

I did post it under Reference#8364-KPK733.

 

It doesn't matter if I use version 1.5.2 or 1.7 of wiimoteLib.dll.

If I use the same dll's with Brian Peek's wiimoteTest.exe (also included in the zip) it all works fine.

 

Regards

Peter

0 Kudos
Message 80 of 220
(5,045 Views)