Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Wii Nunchuk with myRIO I2C

Good Afternoon, Currently I am working on a project which requires control of servo’s using Wii nun chuck. I am using myRIO and communicating with nun-chuck using I2C. I am currently running into problems where the data reading from the Wii is always 255. I am attaching the code as png. currently I am not using any pull-up resistors (I tried with 10k resistor. But same response). I was able to see both data and clock signals using scope. 3.3V connected from myRIO to the nunchuck. If anybody worked with it let me know your thoughts? The nunchuck I was using is here. Thank you.

 

0 Kudos
Message 1 of 5
(3,315 Views)

So the data to the nunchuck is correct, but the data coming back is always 255?

 

myRIO I2C

 

Matthew C

NI | AE

0 Kudos
Message 2 of 5
(3,278 Views)

Thanks for replying matthewRC. As far as I know the data to the nun-chuck is correct. I am following this link which interfaced nun-chuck with arduino. I am also using the same nun-chuck. Attached is the code. Also I tried using pull-up resistors from 100 to 10kohms. Still no change in the data. It is always 255. I am also wondering the I2C read or write VI's end the transmission or not once the execution is finished as noted in line 75 of the arduino code.

 

Thanks for your time in looking into this.

 

Thank you,

Venkata

0 Kudos
Message 3 of 5
(3,267 Views)

It will be a little hard to see where you are going wrong with your code without having the actual VI's (screenshots only help so much). I would highly recommend looking at the link Matthew had sent, as it goes over the use of the I2C express VI's for the myRIO, which will simplify your code and allow you to troubleshoot and eliminate possible hardware issues more easily. Once you have eliminated circuitry as the source of the issue, you can establish your read/writes with the express VI's, then implement the actual I2C API functions if needed from there.

 

I2C Bus Overview: http://www.ni.com/white-paper/9115/en/

CH
Applications Engineering
National Instruments
http://www.ni.com/en-us/support.html
0 Kudos
Message 4 of 5
(3,249 Views)

Thank for your suggestion. I will modify the code with I2C express VI's and let you know about the status. I will also try again using pull-up resistors.

 

Thank you,

Venkata

0 Kudos
Message 5 of 5
(3,243 Views)