I'm trying to read a GC controller input using this library. I followed the wiring guide here and loaded this example program provided in the repository.
Running the program only prints "Error reading Gamecube controller" (GamecubeController.read() returns error code).
Keep in mind that I'm very new to Arduino and all I did was follow the wiring diagram as-is.
Some stuff I'm unsure about:
- The resistor I used has a different color code compared to the one shown, but afaik it still results in 1K Ohms (brown, black, black, brown, gold = 1000 Ohms, +-5%?).
- The diagram shows a button-like thing on the lower part of the breadboard, connecting pin 8 to GND, but it's never mentioned in the guide. I just connected the two directly.
- Line 12 of the example code initializes the controller passing pin 7 as argument, instead of 4 or 8. I tried changing it and reuploading but it still doesn't work.
- The second GND cable from the controller is not connected to anything in the diagram. I connected it to the same line as the other ground cable.
Thanks for the help.
Ok so now I left the pin 8 -> GND disconnected as you said. Changed the code to use pin 4 (as I said it doesn't make a difference for now though).
Yes, I'm using the red board (logic level converter?) and it's wired exactly as in the diagram. I also tested and labeled the 5 wires coming from the extension cord and going to the controller. So that should also be wired correctly.
Something I just noticed: the guide states to use a TX line on the level converter. However the one I'm using was labeled as "bi-directional" and lacks the TX/RX label for the channel, only having high and low voltage pins for the 4 channels. Does that mean that all channels are both transmit and receive? If so that should also be correct.
The board's part number is BOB-12009 by SparkFun Electronics, if that matters.
I solved the problem so I'm gonna answer my own question for anyone having the same issue. The problem was actually very dumb. The logic level converter I bought did not have conductive material on the inside of the female part of the pins on the chip. So basically the male headers I just laid the chip onto weren't making contact at all with the chip. The solution was soldering the headers on the chip and suddently it started working.