Go Down

Topic: Arduino Nes controller, Please Help! (Read 8650 times) previous topic - next topic

Craftee


I'm a janitor, not a policeman.

I clean up after untidy posters.


my post was tidy, till you guys messed it up, and how about you answer my problem so you can stop "cleaning up" the post. instead of wasting time telling me that my post is messy, invest the time into helping someone? get on my level

AWOL


{SIGH}
Code: [Select]
Serial.print(output, BYTE);

Code: [Select]
Serial.write (output);

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Craftee



{SIGH}
Code: [Select]
Serial.print(output, BYTE);

Code: [Select]
Serial.write (output);




cmon im not that stupid. i already tried that.

Groove

Quote
cmon im not that stupid. i already tried that.

Must...resist...
Per Arduino ad Astra

AWOL

Quite.

Here's the error message I got with that one change:
Code: [Select]
Binary sketch size: 2508 bytes (of a 14336 byte maximum)

Over to you.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Craftee


Quite.

Here's the error message I got with that one change:
Code: [Select]
Binary sketch size: 2508 bytes (of a 14336 byte maximum)

Over to you.


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

AWOL

Quote
well when you process it, nothing,

I have no idea what that means.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.


Craftee

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

AWOL

I've already got Processing, thank you, what I don't have is a NES controller.
Have you tried serial debugging your Arduino?
Code: [Select]
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.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Craftee


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"

Nick Gammon


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:

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


C'mon on, we can't read minds.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Nick Gammon


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.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Craftee

Quote


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

AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up