LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Nintendo Wii sensors + Arduino + LIFA

Hello!

I am an engineering student in Brazil and new to LabVIEW and also on the Arduino. I am developing a project, a Quadcopter using the sensors of the controls of the Nintendo Wii (Nunchuk and Wii Motion Plus).

I'd like to read the values ​​of Yaw, Pitch and Roll sensors such an interface in LabVIEW, from the Arduino using the LIFA.

Anyone had any experience with these sensors that can help me? Because I really want to learn this issue, to overcome this challenge. I have LabVIEW 2011 installed, as well as VISA and LIFA.

Already grateful for the attention of everyone!

Henrique

0 Kudos
Message 1 of 11
(5,650 Views)

Henrique,

  It's a little hard to understand what your system would look like. Would you post a system diagram?

Though you could replace the wiimote on the quadropter with some kind of LIFA w/ wireless solution, you might also be able to speak directly to the wii mote with LV. Check out LabviewHacker.com for more.

  It sounds cool. Good luck!

Ben J.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 11
(3,335 Views)

Hello BenJ! First, thanks for answering.

So, what I would do this first part of my project, would be to read the sensor data, Nunchuk and Wii Motion Plus.

I read several documents on how to read the data in passthrough mode. As in this link:

http://voidbot.net/nunchchuk-and-wii-motion-plus-6-DOF.html

But not quite understand how to initialize the sensors and get data via I2C. Would you know how? I think it's not complicated, using the block ready for I2C communication, the present LIFA ("read" and "write"). You are missing a "gentle nudge" for me to understand how. Since I started using LabVIEW few days ago, so I have some doubts on the same schedule.

If you can help me BenJ, I would be very grateful! Thanks.

0 Kudos
Message 3 of 11
(3,335 Views)

Take a look at what the people are doing in the Labview Robitics Community.  See:

<https://decibel.ni.com/content/docs/DOC-1353>

Also search "Discussions" for "Nintendo" in the Labview Robitics Community. 

You may also want to search the Internet for "Arduino Nintendo Wii"

It appears it will be a lot easier to build on what other have done in the Labview Robitcs Community than to try to interface to a Nintendo Wii with LIFA.

Howard

0 Kudos
Message 4 of 11
(3,335 Views)

Henrique,

  Unfortunately I don't have time to show you how, but I do know that there are examples that ship with LIFA that can get you started. You expect this to be wireless, correct? (I assume so because it is a quadropter, but I want to ask). I havent' done I2C wirelessly yet so I am not sure.

  My recommendation would be to get started with a simple example using a wired arduino and LabVIEW, then start adding in I2C, and finally wireless. Look at the I2C examples to ensure they do not use the same pins as wireless (0 and 1 or the RX and TX lines).

Good luck down there in Brazil! One day I will make it down there but for now it's just a dream...

Regards from Austin,

-Ben J

Ben J.
National Instruments
Applications Engineer
0 Kudos
Message 5 of 11
(3,335 Views)

Howard,

Thanks for the info, I'll take a look quite calm in Labview Robitics Community. I am very grateful indeed!

Henrique

0 Kudos
Message 6 of 11
(3,335 Views)

Thanks again Ben J, and forgive me any hassle!

Thanks also for the "strength" in my project, take it all goes well! Hehe ...

When you have time come visit Brazil, you will not regret! It's a beautiful place to learn to relax and enjoy!

Best regards,

Hneirque

0 Kudos
Message 7 of 11
(3,335 Views)

Hello again,

I have done some tests here to read the data from one Wii Motion Plus. The code is very simple, yet I can not read data. As I said earlier before, I am new to LabVIEW and I would like help from someone to read the sensor. Below the figure of the diagram that I'm using:

Diagram.jpg

I do not know if I'm interpreting it wrong to initialize the sensor (Wii Motion Plus):

void wmpOn(){

Wire.beginTransmission(0x53); //WM+ starts out deactivated at address 0x53

Wire.send(0xfe); //send 0x04 to address 0xFE to activate WM+

Wire.send(0x04);

Wire.endTransmission(); //WM+ jumps to address 0x52 and is now active

}

Then I should write 0x00 (zero - in decimal) to request the data to the Wii Motion Plus at 0x52 (82 - in decimal) and collect the same 6 bytes every 100 ms (my choice). As follows:

void wmpSendZero(){

Wire.beginTransmission(0x52); //now at address 0x52

Wire.send(0x00); //send zero to signal we want info

Wire.endTransmission();

}

void receiveData(){

wmpSendZero(); //send zero before each request (same as nunchuck)

Wire.requestFrom(0x52,6); //request the six bytes from the WM+

for (int i=0;i<6;i++){

data=Wire.receive();

}}

The code above can be viewed at: http://randomhacksofboredom.blogspot.com.br/2009/06/wii-motion-plus-arduino-love.html

What am I doing wrong in the above diagram?

I would be grateful if someone could give me a hand. Thanks in advance!

0 Kudos
Message 8 of 11
(3,335 Views)

First thing first.  Does that Arduino code that you got actually work on the Arduino correctly?  I find it strange that the device address is different only for activating the device (it's even different for deactivation, very strange).

Second, there is at least one thing wrong with your LabVIEW code.  I have attached a subVI for you that is based on the code you posted for activating Wii Motion Plus.  You should be able to use the subVI as is for activation but when you look at it's block diagram, you can see how you properly use the I2C Write VI.

Message 9 of 11
(3,335 Views)

Hello,

Today I found this link:

http://innovelectronique.fr/2012/05/23/aduino-et-lifa-episode-2/

Very good, it seems that will help me (a lot) in the solution of my problem! For those who have the same question that I, this is a great place to start!

Soon, if I succeed in my project, I'll post the result here.

Best regards,

Henrique

0 Kudos
Message 10 of 11
(3,335 Views)