Arduino Nes controller, Please Help!

well night, ive been trying to solve this for 8+ hours now. its 3am, bye

I've already got Processing, thank you, what I don't have is a NES controller.
Have you tried serial debugging your Arduino?

const int latch = 2;
const int clock = 3;
const int data  = 4;

#define latchlow digitalWrite(latch, LOW)
#define latchhigh digitalWrite(latch, HIGH)
#define clocklow digitalWrite(clock, LOW)
#define clockhigh digitalWrite(clock, HIGH)
#define dataread digitalRead(data)
#define wait delayMicroseconds(200)

byte output;

void setup() 
{
	Serial.begin(9600);
	pinMode(latch, OUTPUT);
        pinMode(clock, OUTPUT);
        pinMode(data, INPUT);
}

void loop() 
{
  output = 0;
  ReadNESjoy();
 // Serial.write(output);
  Serial.println ((unsigned int)output);
}


void ReadNESjoy() 
{
  latchlow;
  clocklow;
  latchhigh;
  wait;
  latchlow;
  for (int i = 0; i < 8; i++) {
     clockhigh;
     wait;
     output += dataread * (1 << i);
     clocklow;
     wait;
  }
}

See what you get in the serial monitor.

AWOL:
I've already got Processing, thank you, what I don't have is a NES controller.
Have you tried serial debugging your Arduino?

See what you get in the serial monitor.

i dont know how to debug, and when i serial monitor, i get a bunch of "0"

Craftee:
so i have this old peice of code here, and i get an error saying "The 'BYTE' keyword is no longer supported" so what do i use instead? please help!

This is a really confusing thread. I got the impression until the last post or so that you hadn't solved the above problem, after all the begging for help.

Instead, you have solved it and replaced it with another one (the sketch compiles but doesn't do what you expect).

You could have made that a lot clearer, instead of:

well when you process it, nothing, i got no errors with processing... so...

C'mon on, we can't read minds.

Craftee:
i dont know how to debug, and when i serial monitor, i get a bunch of "0"

Copy and paste what you get in the serial monitor.

Copy and paste what you get in the serial monitor.

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

and it spams it, nonstop

So, what does that tell you?

How have you wired it up? A very clear photo would help answer that.

What happens if you press buttons on the controller, or move things? Getting zero seems to say to me nothing is pressed.

even if i press something i still get nothing. just "0"

I honestly can't tell from that if you followed the instructable or not. Let's hope.

what do you mean?.

The pictures have stopped displaying. I suggest you upload them as an attachment. Click on "Additional Options" below the post to do so.

IMAG0667.jpg

IMAG0668.jpg

IMAG0669.jpg

i cleaned it up a bit, it should be easier to see

IMAG0671.jpg

IMAG0670.jpg

Well judging by this that I found after Googling you may not have the wires right:

You have Gnd (brown) going to pin 4.

Although this says differently:

Now that you understand the pins on the Nintendo controller, hook up your jumper wires by using arrow’s colors from the photo above. (Note: The pins are fairly deep, be sure that your wires are deep enough and snug to insure a strong connection)
As for the other ends of the wires, place the RED wire from +5V on the Nintendo controller to 5V on the Arduino. Place the BLACK wire from GROUND on the NES controller to GROUND on the Arduino. Pretty straight forward.
Place the ORANGE wire from STROBE on the NES controller to Digital Pin 2 on the Arduino.
Place the WHITE wire from CLOCK on the NES controller to Digital Pin 3 on the Arduino.
Place the YELLOW wire from DATA on the NES controller to Digital Pin 4 on the Arduino.
NES Wired

All I am saying is, try to be absolutely certain you have the wiring right.

Do you remember which colour went into which pin on the plug? Or do you have another one to compare to?

i feel stupid, i accidently switched the yellow and brown, its working now, but when i run processing and open up notepad, i get nothing