The reading of the Nunchuck is similar to read of the motionplus. The biggest Problems are the timining errors. Since i used a 16MHz Oscillator my microcontroller an 400khz as my I2C speed, the communication was often to fast when reading the data. When this happens the nunchuck hangs and does nothing more.
Motion Plus
I2C Adress: 0xa4
I2C Enable Register 0xf0 (Value 0x55)
I2C Extension ID: 0xFA to 0xFF (0000 A420 0000)
I2C Motion Read Register: 0x00 (6 bytes)
The Nunchuck is first initialized writing 0x55 to Register 0xF0. After This step it might be needed to wait some cycles. The six bytes are aquisitioned by reading beginning at the register 0x00. The data can be dechiffred by using the following code:
nunchuck.stick_x = data[0]; //8bit value
nunchuck.stick_y = data[1];
nunchuck.acc_x = (data[2] <> 2) & 0x03); //10bit value
nunchuck.acc_y = (data[3] <> 4) & 0x03);
nunchuck.acc_z = (data[4] <> 6) & 0x03);
nunchuck.button1 = data[5] & 0x01; //boolean
nunchuck.button2 = data[5] & 0x02;