PS2 Controller Hookup

I recently saw this post on the adafruit site and thought I would give it a go.

I am using an original dual shock playstation 2 wired controller and an arduino duemilanove.

The original article is here: http://code.google.com/p/smduino/wiki/PlaystationControl

The source for that code is here: Interfacing a PS2 (PlayStation 2) Controller - Curious Inventor

I have connected the PS2 wires to the arduino as shown in the code but all I get from terminal is "yy yy yy yy yy yy..."

I definitely have power to the controller because the indicator LED lights up when I push the analog button.

here is a pic of the wires:

here is the schematic: http://smduino.googlecode.com/files/SMDuino%20-%20Playstation%20Control.pdf

In the code it states which wires go to which arduino pins:

 ps2x.config_gamepad(3,5,6,4, false, false);   //setup pins and settings:  GamePad(clock, command, attention, data, Pressures?, Rumble?) check for error

I have wired all the PS2 wires according to the color label chart and the instructions in the code but I am still getting "yy yy yy yy..." in terminal.

I have even tried using level shifting resistors incase the controller needs a 3 volt supply, but it didn't change anything

I have also already changed the baud rate in terminal to 57600 because the code initializes serial at 57600

Does anyone have ideas on what to do? I'm stuck.

yy yy yy yy yy yy

Sounds like the wrong baud rate to me. Can you copy and paste the code you are actually using please?

Here is the actual code:

// This program compiles the Playstation controller button statuses into a 6 byte string.
// The first 2 bytes contain button status and the last 4 contain the thumbstick positions.
// by Adam Kemp, 2012 http://code.google.com/p/smduino/

#include <PS2X_lib.h>  //for v1.6 (Thanks to Bill Porter for a wicked library http://www.billporter.info/playstation-2-controller-arduino-library-v1-0/)

PS2X ps2x; // create PS2 Controller Class

int battLow = 801;  //Batt low value determined from 22k/100k voltage divider. Represents ~3.3V
boolean lowBattWarning = false; //flag for a low battery condition
boolean ledState = false; //used for flashing LED during a low power condition
unsigned long currentTime = 0;

void setup(){
 Serial.begin(57600);
  pinMode(13, OUTPUT);
  for (int i = 0; i < 4; i++) { //check status LED
    digitalWrite(13, LOW);
    delay(50);
    digitalWrite(13, HIGH);
    delay(50);
  }
  digitalWrite(13, HIGH);
  ps2x.config_gamepad(3,5,6,4, false, false);   //setup pins and settings:  GamePad(clock, command, attention, data, Pressures?, Rumble?) check for error
}

void loop(){
  byte buttons = 0;
  byte dPads = 0;
  ps2x.read_gamepad();
  bitWrite(buttons, 0, ps2x.Button(PSB_SELECT)); //byte 1, bit 0
  bitWrite(buttons, 1, ps2x.Button(PSB_START)); //byte , bit 1
  bitWrite(buttons, 2, ps2x.Button(PSB_L1)); //byte 1, bit 2
  bitWrite(buttons, 3, ps2x.Button(PSB_R1)); //byte 1, bit 3
  bitWrite(buttons, 4, ps2x.Button(PSB_L2)); //byte 1, bit 4
  bitWrite(buttons, 5, ps2x.Button(PSB_R2)); //byte 1, bit 5
  bitWrite(buttons, 6, ps2x.Button(PSB_L3)); //byte 1, bit 6
  bitWrite(buttons, 7, ps2x.Button(PSB_R3)); //byte 1, bit 7
  bitWrite(dPads, 0, ps2x.Button(PSB_PAD_UP)); //byte 2, bit 0
  bitWrite(dPads, 1, ps2x.Button(PSB_PAD_DOWN)); //byte 2, bit 1
  bitWrite(dPads, 2, ps2x.Button(PSB_PAD_LEFT)); //byte 2, bit 2
  bitWrite(dPads, 3, ps2x.Button(PSB_PAD_RIGHT)); //byte 2, bit 3
  bitWrite(dPads, 4, ps2x.Button(PSB_GREEN)); //byte 2, bit 4
  bitWrite(dPads, 5, ps2x.Button(PSB_BLUE)); //byte 2, bit 5
  bitWrite(dPads, 6, ps2x.Button(PSB_PINK)); //byte 2, bit 6
  bitWrite(dPads, 7, ps2x.Button(PSB_RED)); //byte 2, bit 7
  Serial.print(buttons); //prints byte 1
  Serial.print(dPads); //prints byte 2
  Serial.print(ps2x.Analog(PSS_LY)); //prints left y thumbstick value
  Serial.print(ps2x.Analog(PSS_LX)); //prints left x thumbstick value
  Serial.print(ps2x.Analog(PSS_RY)); //prints right y thumbstick value
  Serial.print(ps2x.Analog(PSS_RX)); //prints right x thumbstick value
  byte battStat = map(analogRead(0), 801, 1024, 0, 100); //reads batt voltage and calculates a percentage. 3.3v = 0%
  if (battStat <= 10) { //not tested, but checks if the battery is below 10%
    lowBattWarning = true;
  }
  if (lowBattWarning) { //if battery is below 10% start flashing the LED
    if (millis() > currentTime + 1000) {
      currentTime = millis();
      digitalWrite(13, !ledState);
    }
  } 
 delay(100); //rinse, wash, repeat
}

Here:

Serial.print(buttons); //prints byte 1
  Serial.print(dPads); //prints byte 2
  Serial.print(ps2x.Analog(PSS_LY)); //prints left y thumbstick value
  Serial.print(ps2x.Analog(PSS_LX)); //prints left x thumbstick value
  Serial.print(ps2x.Analog(PSS_RY)); //prints right y thumbstick value
  Serial.print(ps2x.Analog(PSS_RX)); //prints right x thumbstick value

Try adding DEC to them, as in:

Serial.print(buttons, DEC); //prints byte 1

and so on.