Wii motion + output error with Arduino UNO

Hey everybody,
I'm pretty new to arduino and hardware hacking in general, but decided to tackle the gyro sensor project with the wii motion +. It seemed pretty simple enough and I found a lot of threads that deal with this, but I can't seem to find any threads dealing with an issue I've been having. Here's what I did:

First, I hooked up a few jumpers between the 3v and GND plugs on my Arduino UNO to a breadboard. I then connected two 470 ohm resistor in series with the 4th and 5th analog inputs on the Arduino. Finally all of that was connected from the breadboard to the proper inputs on the WM+ male lead. I uploaded the code that I got from [Make: Projects] onto my arduino uno but when I started up the serial monitor the WM+ is outputs unreadable data.

Example:
´ÖË0üÉ=þLe±ü!Rÿ×?ÿdÿ©$þuñ ÆþÓKÿË?eÂú?,òü?!Ó?[1Ӑÿ3éôÒ§Éq²!KÉþ1þ9^þ ÔòÉBþÉþ²Ó²ü?ÍBþ£0þ8 ©eÿÂúBÿ!? Äþ
ÈþÀê!É2ÿ¨1Éÿ×Øü?üÕ¦²þ Àê"¦þdþÉ?ÿKKþ Àý?ü?þ?þB9üÉÓþßÿ0ü?!Ì!I?É<ÿ¦ÉqI?IÌ%eI­ ­É²d -[I¬Ì2É=ÿI­$ÒÌ!'e²ÿɲɲI?3íÉqÉq%[ 2ÿɲKJ?!¶IÖÌ!ɲdeɲ%[²ÅKÒɲ%[ÉqÌ2ɲe§²ÿ§É?²ÿɲ?!?!e§5×ß%[²2Á%e?!%[§I ³ÿɲ?!3ÿÉ1?!I¬5ÁuÒ§ ­-[ %[%[É?Éqe5ÿ§

So I abandoned the male lead connector and soldered the wires from the rainbow leads to a few jumper cables and I got the same output. Anybody know what I'm doing wrong?

Your link doesn't seem to work, so I can't see the code. It looks like it could be a baud rate mismatch. Have you got the speed in the serial monitor matching the Serial.begin() in the code?

Here is the code I'm working with

/*
Make Projects
Arduino Wii Motion Plus Data Reader
This code is used for the Make Projects: Wii Motion Plus on the Arduino.
Miles code did not include a license however we would like to thank him for posting it!
Author: Miles Moody
Home Page:

*/

#include <Wire.h>

byte data[6]; //six data bytes
int yaw, pitch, roll; //three axes
int yaw0, pitch0, roll0; //calibration zeroes

void wmpOn(){
Wire.beginTransmission(0x53); //WM+ starts out deactivated at address 0x53
Wire.write(0xfe); //send 0x04 to address 0xFE to activate WM+
Wire.write(0x04);
Wire.endTransmission(); //WM+ jumps to address 0x52 and is now active
}

void wmpSendZero(){
Wire.beginTransmission(0x52); //now at address 0x52
Wire.write(0x00); //send zero to signal we want info
Wire.endTransmission();
}

void calibrateZeroes(){
for (int i=0;i<10;i++){
wmpSendZero();
Wire.requestFrom(0x52,6);
for (int i=0;i<6;i++){
data*=Wire.read();*

  • }*
  • yaw0+=(((data[3]>>2)<<8)+data[0])/10; //average 10 readings for each zero*
  • pitch0+=(((data[4]>>2)<<8)+data[1])/10;*
  • roll0+=(((data[5]>>2)<<8)+data[2])/10;*
  • }*
  • Serial.print("Yaw0:");*
  • Serial.print(yaw0);*
  • Serial.print(" Pitch0:");*
  • Serial.print(pitch0);*
  • Serial.print(" Roll0:");*
  • Serial.println(roll0);*
    }
    void receiveData(){
  • wmpSendZero(); //send zero before each request (same as nunchuck)*
  • Wire.requestFrom(0x52,6); //request the six bytes from the WM+*
  • for (int i=0;i<6;i++){*
    _ data*=Wire.read();_
    _
    }_
    yaw=((data[3]>>2)<<8)+data[0]-yaw0; //see Wiimote/Extension Controllers - WiiBrew*

    * pitch=((data[4]>>2)<<8)+data[1]-pitch0; //for info on what each byte represents*
    * roll=((data[5]>>2)<<8)+data[2]-roll0;*
    }
    void setup(){
    * Serial.begin(115200);*
    * Serial.println("WM+ tester");*
    * Wire.begin();*
    * wmpOn(); //turn WM+ on*
    * calibrateZeroes(); //calibrate zeroes*
    * delay(1000);*
    }
    void loop(){
    * receiveData(); //receive data and calculate yaw pitch and roll*
    * Serial.print("yaw:"); //see diagram on randomhacksofboredom.blogspot.com*
    * Serial.print(yaw); //for info on which axis is which*
    * Serial.print(" pitch:");*
    * Serial.print(pitch);*
    * Serial.print(" roll:");*
    * Serial.println(roll);*
    * delay(100);*
    }
    /*
    Additional Reading:
    The wii motion plus's initialization sequence was pull from here:
    Wiimote/Extension Controllers - WiiBrew
    The data format is well documented here:
    Wiimote/Extension Controllers - WiiBrew
    More pinout diagrams can be found here:
    Wiimote/Extension Controllers - WiiBrew
    */
    I haven't set the speed in the serial monitor nor would I know how to do that...

actually yes, it's set to 9600 baud

edit:

Hey thanks a lot I was able to figure it out from there! It's printing perfect now!

I'll be browsing the thread a bit more so I dont run into a mistake like this again....