I am making a game on an Arduino which needs 4 controllers, and thought I would connect N64 controllers to it. I connected one successfully, but was unable to successfully connect more. The code I used can be found on the instructables website here. I could really use help with adding the other 3 controllers; I attempted to and the result was 4 controllers half working some of the time. If anyone knows how to manipulate the code, or knows a better one, I could really use you. Any and all help will be appreciated.
I know to change the N64 data pin you need to change the "2" in "#define N64_PIN 2" to the pin that you want, along with changing the "0x04"s in
"
#define N64_HIGH DDRD &= ~0x04
#define N64_LOW DDRD |= 0x04
#define N64_QUERY (PIND & 0x04)
"
to 2 to the power of the pin that you want.
So if you want the pin to be pin 3 on the Arduino, you would put:
#define N64_PIN 3
#define N64_HIGH DDRD &= ~0x08
#define N64_LOW DDRD |= 0x08
#define N64_QUERY (PIND & 0x08)
0x08 because 2^3 = 8.
How do you make so there are multiple controllers though?
Okay, so I was messing around with the N64 controller code a lot more, and pretty much got to the same state I was before: instability and unpredictability.
However, I noticed something odd: certain controllers do not work well in certain slots. So, I played around a little, and found out that if I connect 4 certain controllers in a certain order, then it works without any glitches (not that it matters, but that order is grey, black, red, purple.)
Uhh... I'm guessing there is something wrong with... something. Anyone know what could be the problem? My wires are not fully covered (but are not making contact with anything else) and the connecting wire from the controllers to the Arduino is kind of long (a foot max.) Might this have anything to do with it (noise)? This really does not make sense to me.