With-wii-motion+

This example shows how to connect a Pinguino board to the Wii Motion Plus.

The Wii Motion Plus is a 3-axis electronic gyroscope; it uses a IDG600 chip from Invensense.

It can be used for robotic applications or movement tracking.

The code uses the LibI2C module in Pinguino. We adapted the I2C initialisation to work with a clock frequency of 100 kHz. The output sends value to the serial port.

The beta 9-05 version is used to compile the code.



How to connect it ?
A piece of double-sided PCB has been used to make a male connector.



Pinguino is connected to the Wii Motion Plus via the I2C bus.

SCL is PIN 0 and SDA is PIN 1.

The Wii Motion Plus is powered from the 5vcc Pinguino power supply.

Pinguino Breadboard


Two 22k resistors are used as pull-ups on the SDA and SCL lines.

Test is on a 18F2550 Pinguino but it can also be wired on a 18F4550.

The code
6 bytes are read from the Wii Motion Plus. Each byte is the value of a sensor.

byte 0 is the yaw down speed (bit 7-0), byte 1 is the roll left speed (bit 7-0), byte 2 is the pitch left speed (bit 7-0),
 * byte 3
 * bit 7-2 is bit 13-8 of the yaw down speed,
 * bit 1 is the yaw slow mode,
 * bit 0 is the pitch slow mode,


 * byte 4
 * bit 7-2 is bit 13-8 of the roll left speed,
 * bit 1 is the row slow mode,
 * bit 0 is the extension connected bit,


 * byte 5
 * bit 7-2 is bit 13-8 of the pitch left speed,
 * bit 1 is always 1,
 * bit 0 is always 0.

More about the Wii Motion Plus
WiiBrew website

Invensense website