So fired it up and hit the tab button to configure the buttons but but when i press the buttons it causes the RPI to reboot. On the upside i guess at least its registering button clicks but still not working correctly. Went back and checked ground cables and all the other wiring but seems okay. Can anyone out there think of something i might have missed?
Thanks mholgatem. So had another look over and discovered that I had all the grounds daisy chained together rather than a daisy chained loop for each player. Fixed that but still the same problem (reboot on button press). I assume the order of the buttons connected to the ground makes no difference. Can't see any dodgy connections. Hmm whet to now... There are 3 tabs on each button. The one that lays flat seems to be the ground in the wiring diagram, the other two I'm using the top one, should I not be?
If you have 3 tabs, then chances are that they are 'contact on open', 'contact on close', and 'ground'. Contact on open, will mean that the button is making the circuit when it's not being pressed. contact on close will mean that the button works like a regular button, completing the circuit when it's pressed. So you may try switching them to the other tab? It doesn't explain why it would only mess up when you pressed a button though.
Okay so rather than trying those different tabs i thought i'd try using a multimeter to see if there was current making it to the breakout board. Got 5v between one of the 5v pins and a button so thats all good, i know the breakout works. Then thought i'd try to use a wire to connect a ground to a button on the breakout see if i get the same problem as pressing a button. Did that and pretty sure that slipped and touched a terminal next to it now the pi wont boot up, the red light is on but nothing, piplay wont come up, nothing comes up. Could i kill the pi by connecting two of the wrong GPIO pins together (eeeeek)?
So got back onto this today and thought that'd rather than disconnect and reconnect everything i'd make a small tester with a battery and globe. Going through each of the buttons and connecting them to ground and button and the light comes on when the button is pressed or joystick moved. Works a treat and everything seemed to work fine.
Next step i got rid of the controllers completely and connected a jumper cable to the ground and the other where the button should be and touched the two together, voila reboot. So exactly the same thing I'm getting with my controller.
One thing that could be a problem, when i type "make". I get the error (well i think its an error or not the right thing anyway): make: Nothing to be done for 'all'.
I assume this is stumbling at the first hurdle? Should i be typing in something different?
Will look into that, thanks for the help mholgatem.
Out of interest and on a similar note I've been playing around with VNC viewing, is there a simple shell command i can use to see what scripts are running in the background (I'm sure there is, will go looking)?
BTW to answer your question my pins are all configured the way the wiring diagram shows, not the same way as the code or it would be it would be 5v going to ground as per. GPIO 02 -> KEY_UP // Up (says this in the tutorial, but GPIO 02 is actually a 5V pin) GPIO 03 -> KEY_UP // Up (shows this in the wiring diagram)
I assume that the labeling is off and the code is using pins going down one side then down the next in columns, rather than the actual number which goes right left right left.
So the way I've been connecting is the 1UP controls down the left side of the GPIO and the 2UP down the right. Is this not right? Do in need to change the code perhaps? If so is that a matter of adjusting the retrogame.c file?
So ran ./retrogame and sits there as though its running. I assume i can run ./retrogame & so as to free up the command line to fired up Piplay? I did actually just type "exit" after launching retrogame and Piplay fired up (hopefully thats not killing off retrogame prior to launch)? Once it started connected up the two wires (ground and button 4) and touched... reboot.
Also had a look through the code to see if anything was amiss and all seems good, have not adjusted anything.