I am trying to connect my WiiChuck to my ATmega32u4 MCU, anybody know which pins need to be connected?
Not 100% clear, but may I guess:
You want to connect a Wii Nunchuk
to an Arduino Leonardo or Micro (they use a ATmega32U4 microcontroller).
The Nunchuk is connected via I2C to the microcontroller board (example: Arduino and Wii Nunchuk to control iTunes)
The person in the example uses something like an Arduino Uno (ATmega328P).
The I2C pins on the Uno are brought out at Analog 4 (SDA) and Analog 5 (SCL).
But on the Arduino Leonardo or Micro the I2C pins are D2 (SDA) and D3 (SCL).
So after cutting the Wii Nunchuk wire, the connections to Arduino Leonardo/Micro are:
Nunchuk white (GND) to Arduino GND
Nunchuk red (VCC) to Arduino 5V
Nunchuk yellow (clock) to Arduino D3 (SCL)
Nunchuk green (data) to Arduino D2 (SDA)
Clock line to VCC via 10k (or less) resistor
Data line to VCC via 10k (or less) resistor
Yep you had it correct, I saw this configuration elsewhere, but I just wanted to be sure. Im waiting for some WiiChuck shields in the mail, and I wanted to try and plug it in before they arrived. I am designing games on this: - YouTube and I wanted to use the Wii nunchuck as the controller. So the resistors will be used as jumpers?
LightcubeZ:
So the resistors will be used as jumpers?
The resistors are "pull up resistors", connecting both lines (SCL and SDA) to +5 V. They are needed for proper communication on the I2C lines, as I2C devices can only pull the lines low (to GND).
Example for connection the pull up resistors:
You can see the pull up resistors on bottom left (4.7 kOhm). The example ist from here: arduino.cc/en/Tutorial/DigitalPotentiometer.
Keep in mind that this example (like most) show I2C connection with Arduino UNO (ATmega328P), so SDA/SCL is on A4/A5. But if you use your board (with ATmega32U4) you have to make I2C connections to D2/D3 instead but use pull up resistors the same way.
The board I am working with is this:
It has already has a place for the pullup resistors, so I am assuming that I will run this nunchuck into the comms input.
LightcubeZ:
It has already has a place for the pullup resistors, so I am assuming that I will run this nunchuck into the comms input.
Yes, looks like you can connect the Nunchuk wires with the "Comms Input" SCL, SDA, GND, +5V
And you should place pullup resistors as it is said in the instrucktions to the board:
For i2c peripherals, if you connect devices that don't contain their own bus pullup resistors then you will need to solder 4.7K (or similar) resistors in the two spaces marked on the PCB as "SCL PULLUP" and "SDA PULLUP".
So the moral of the story is read the documentation first! Thanks for the replies though, it has given me something to think about.