Talk:Wiimote/Extension Controllers/Nunchuk

From WiiLi

Jump to: navigation, search

Hi to all. We are interested to connect the Nunchuk to a PC, Linux or Windows XP. Is there a real poject to write the interface here on this Wiili.org, or somewhere else? Please, let us know.

Thank you all, and congratulation for your work.

Alain Hubrecht

What exactly are you looking for? All information that's necessary to use the Nunchuk on a PC is complete, and quite a number of PC apps can already use it, for example GlovePIE.

Contents

[edit] Coms with the Nunchuk

From what I understood, I can connect a Wiimote to a PC via Bluetooth and then do whatever I want, even without having the Wii console. The GlovePIE application that you mentioned allows to do several things, even communicate with the Nunchuk. But where should the Nunchuk be connected in order to control it?To the Wii console?To the PC(how?)?.....I hope that my question is clear enough. Alessandro

  • There is only one port you can connect the Nunchuk to - and that's the expansion port on the bottom of the Wiimote. The Nunchuk always needs to be connected to the Wiimote's expansion port; and once it is attached there, you communicate with it by communicating with the Wiimote (via Bluetooth): You send certain commands to the Wiimote, and if they affect the device attached to the Wiimote's expansion port (the Nunchuk or the Classic controller) the Wiimote will automatically communicate with this device, so you actually never communicate with the Nunchuk directly. Cadex 09:27, 18 January 2007 (EST)

[edit] Move to Wiimote/Nunchuk

I propose that we move this article to Wiimote/Nunchuk--Henke37 05:01, 12 February 2007 (EST)

[edit] Connecting the Nunchuk to a PC over I2C

(Moved from article:) Rightnow, I am doing a project in which I want to use just the Nunchuk as a joystick. In order to implement this, I am trying to find a way to get the data from the IIC bus using the parallel port in the PC. But I have a question about what kind of data I have to write to Nunchuk to receive the data. Is somebody have some ideas about this? - If you can speak 400kHz I2C, you should be able to do this. The nunchuk's slave address is 0x52. Send it one byte, 0x00, then read 8 bytes from it (they are all 0xff), then read another 8 bytes (these contain the paylod in the same "encrypted" format as the bluetooth HCI packet). --Zudini 18:53, 23 February 2007 (EST)

[edit] Note from Thutmosis

yes, I did set the byte to 0x01 to initialize the Expansion. But it works very well here. I don't need to decode the nunchuk buttons with ^0x17 + 0x17, the raw input data is already correct. Question: which method is correct?

  • Initializing with an other value than 0x00 isn't "incorrect", but it only makes things more complicated. When you initialize with 0x00, ALL bytes read from the expansion port can be decoded with the default ^0x17 + 0x17 algorithm. If you use an other value instead, SOME bytes will need to be decoded with (^0x17 + 0x17), but other bytes (for example the byte that contains the button state) will need a slightly different decoding algorithm instead (depending on which value you used to initialize) - otherwise you get false values like the ones you had, where the state of the buttons isn't encoded in bit flags. Cadex 05:04, 15 January 2007 (EST)

[edit] RWagner's info

My nunchuck has the following 16 bytes repeated twice starting at address 0x04A40020 (the rest of the data is similar to the dump above). RWagner

7F 7D 7F 5A 8D EB 8C E8 D3 12 71 7F 1A DD F4 2F 
Thank you so much for that info! it made me realize that I had messed up my Nunchuk by overwriting the calibration data with dummy values. I went to the store and exchanged it for a new one, and then I was able to solve some more parts of the puzzle. You still seem to be using value 0x01 for initialization by the way, which is why you had to decode some of the values with a different value than 0x17. Cadex

I have read and decoded the calibration data from all four of my nunchucks:

7F 81 7F 03 B1 B2 B2 16 DB 1C 7D E0 24 80 FA 4F
7F 81 7D 3E B2 B3 AF 27 DE 1C 81 E0 24 83 4D A2
7C 81 80 22 AF B1 B6 2C DC 1B 84 E1 1F 86 37 8C
7B 7C 7D 28 B1 AD B0 1D E4 1F 7D E1 1D 7F 19 6E

The accelerometer calibration values are definitely consistent. I also found that bytes 8-13 describe the calibration of the joystick (maximum, minimum, then center for the X axis then the Y axis) consistently for each nunchuck. The other bytes may be checksums of some kind.

[edit] Firoball's info

Calibration data starting at address 0x04A40020 of my Nunchuk:

80 79 77 0C B4 AC AB 0C E9 23 7D E4 22 7B F2 47

retrieved using a dirty hack based on cWiiMote. Hope it is useful to you. For reading the calibration data properly with cWiiMote it must be read twice for some reason. Be sure to modify the source code accordingly, as the latest release of cWiiMote uses standard values by default. Firoball

[edit] Little note by Crono

I know I am really nobody here, I'm just a VG player, but I like to see all of this stuff you guys do here, and I do really appreciate it. Maybe I just don't have knowledge enough, but I think no-one talked about the fact that the Nunchuk knows its relative position. To better explain, take Wii Sports-Boxing: the Mii's left hand (for right-handed players) follows the position (besides the movements) of the Nunchuk. Tilt it left, it moves left: this is the accelerometer, ok; leave it tilted left: the hand stays tilted left, and vice versa. I hope I made my concept clear... I don't know if I helped you or just made you waste time. Excuse me if the second statement is the right one, and feel free to delete this opinion in case. Crono

I guess you're confused by the fact that the Nunchuk knows that it's tilted even if it doesn't move (so there seems to be no acceleration that the acceleration sensors could measure). This is actually just a common misbelief: The acceleration sensors measure an acceleration even if the Nunchuk is lying still: earth's gravity. For more information, see Motion analysis. Cadex 17:46, 1 January 2007 (EST)
To be extremely accurate, it is the normal force of the gravitational force that the Nunchuck is measuring.--Henke37 16:25, 1 June 2007 (EDT)

[edit] Random crap

User:paporas: A question: How can I connect the Nunchuk to a PC?It is not wireless, so do I still need to keep it connected to the Wii console in order to control it with my PC?Thank you!

User:toni: you don't connect the nunchuck to a pc or even the wii, you connect it to the wiimote. Read Above the first line says it :)

User:fill: Actually, it is *possible* to connect a nunchuck to a PC. You need an I2C bus to connect it to, as well as power. You can use a 'bit-banging' driver on the parallel port to make an I2C bus, or some other available I2C bus (I used to use the bus on my vid card to testing). You just have to make sure the signaling and voltage requirements are met.

[edit] Acceleration data

Could someone explain a little more how the acceleration data works in the 6 byte? "Bits 2-3: X acceleration LSB / Bits 4-5: Y acceleration LSB / Bits 6-7: Z acceleration LSB"

I am not quite understanding it. thanks -- Tempalte 15:15, 5 June 2007 (EDT)

Personal tools
Online Casino - best online casino reviews.
Facebook Developers - facebook applications, facebook developers, facebook development, social network application development and viral widget social media strategy