The Raspberry Pi connection
For the connection with our Raspberry Pi, we just have to connect it to the main connectors, I2C1_SDA and I2C1_SCL, as shown in this pin diagram:
The Nunchuck's protocol
The Wii Nunchuck contains a controller that communicates through the i2c bus. In order to know where to store bytes written to it, the first byte must be an 8-bit register address. In other words, each write()
operation to the Nunchuck requires one register address byte, followed by data bytes.
For a write operation, the first byte sent to the Nunchuck tells it where to start (the START condition).
Encryption
The Nunchuck is designed to provide a specific encrypted link. However, this can be disabled through the following process:
- Write 0x55 to the Nunchuck's 0xF0 register
- Pause
- Write 0x00 to the Nunchuck's 0xFB register
Write |
Pause |
Write | ||
0xF0 |
0x55 |
- |
0xFB |
0x00 |
Note that if you own a white Nunchuck, the process will be different:
- Write 0x00 to the Nunchuck&apos...