Arduino Nes controller, Please Help!

Absolutely you can do that.

just one problem, i dont know how to make the code get the information that the controller is sending.
like i was thinking

if (input == 127)
  emulateKey(A)

or something like that.

idk, a little directional help would help

Take a look at this post:

I press a button on a keypad, and it "types" stuff into a forum message.

a little directional help would help

Over there!

Seriously, what is that supposed to mean?

What is the Arduino code doing?
You have to describe it because we can't see it.

AWOL:

a little directional help would help

Over there!

Seriously, what is that supposed to mean?

What is the Arduino code doing?
You have to describe it because we can't see it.

directional help to get started in emulating a keyboard? because i dont know how to integrate it into my code?

i read your post, but im still confused as to how to let the arduino know that button "a" was pressed?

im so confused

You are going to have to stop asking questions and start writing some code.

Do you have a way if knowing if button "a" is pressed? I guess so, because you had numbers flashing by.

Don't keep asking "how do I do it"? Make an attempt, and post the code.

ive been attempting for over 20+ hours now. what more do you want from me? im just a kid!

im just a kid that needs help, gosh!

Craftee:
im just a kid that needs help, gosh!

If you think you are capable of solving this problem already with a little help, then you ought to be at least part way there on your own. Show us where you've got so far and which part you need help with, and no doubt there will be plenty of people willing to steer you round the problem.

If you simply don't know where to start, then put this project down and start with something simpler. It's best not to try to boil the ocean - learn things one step at a time.

Craftee:
i feel stupid, i accidently switched the yellow and brown, its working now ...

OK. What's working? Are you getting numbers in the serial monitor? What number do you see if you press button "a"?

yea i get numbers, when i press "a" the number doesnt change, its just 127.
and i just need help converting the numbers into key emulations

PeterH:

Craftee:
im just a kid that needs help, gosh!

If you think you are capable of solving this problem already with a little help, then you ought to be at least part way there on your own. Show us where you've got so far and which part you need help with, and no doubt there will be plenty of people willing to steer you round the problem.

If you simply don't know where to start, then put this project down and start with something simpler. It's best not to try to boil the ocean - learn things one step at a time.

well i wanna do a project that matters to me, not just some flop project i wont learn anything from, because more often than not, i find myself copying code. i know very little about code.

Well, try something and post what you tried.

What have you tried?

:confused:

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);
        while (! Serial ) { }
	pinMode(latch, OUTPUT);
        pinMode(clock, OUTPUT);
        pinMode(data, INPUT);
        Keyboard.begin();
}

void loop() 
{
  if(KeyboardSerial == 127)
  Keyboard.press(a)
    else ()
    Keyboard.release()
  if(KeyboardSerial == 126)
  Keyboard.press(b)
    else ()
    Keyboard.release()
  if(KeyboardSerial == 119)
  Keyboard.press(up_arrow)
    else ()
    Keyboard.release()
  if(KeyboardSerial == 111)
  Keyboard.press(down_arrow)
    else ()
    Keyboard.release()
  if(KeyboardSerial == 63)
  Keyboard.press(right_arrow)
    else ()
    Keyboard.release()
  if(KeyboardSerial == 95)
  Keyboard.press(left_arrow)
    else ()
    Keyboard.release()
  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;
  }
}

You have to start thinking about what you are doing.

void loop() 
{
  if(KeyboardSerial == 127)
 ...

What is KeyboardSerial?

Previously you were displaying the value of output. So surely you want to test that?

void loop() 
{
  if(output == 127)
 ...

But, wait! You are testing it before you find out what it is.

How about:

void loop() 
{
  output = 0;
  ReadNESjoy();

  if(output == 127)
 ...

It's not magic. Think about what the variables mean and use them in a useful way.

void loop() 
{
  output = 0;
  ReadNESjoy();
  Serial.println ((unsigned int)output);
  
  if(output == 127)
  Keyboard.press('a')
    else ()
    Keyboard.release()
  if(output == 126)
  Keyboard.press('b')
    else ()
    Keyboard.release()
  if(output == 119)
  Keyboard.press('up_arrow')
    else ()
    Keyboard.release()
  if(output == 111)
  Keyboard.press('down_arrow')
    else ()
    Keyboard.release()
  if(output == 63)
  Keyboard.press('right_arrow')
    else ()
    Keyboard.release()
  if(output == 95)
  Keyboard.press('left_arrow')
    else ()
    Keyboard.release()
  if(output == 123)
  Keyboard.press('s')
    else ()
    Keyboard.release()
  if(output == 125)
  Keyboard.press('l')
    else ()
    Keyboard.release()

}

it says ";" is expected before else, im not sure where to put it....

Find a book on programming in C. Read it.

well i wanna do a project that matters to me, not just some flop project i wont learn anything from

You wanna learn? Start reading.