rupello Posted September 12, 2015 Report Share Posted September 12, 2015 I'm a newbie trying out the Gameduino samples and having a problem with my joystick, which I think is a clone of the old Atari 2600 style. When I run the joytest sample my left, right, and back work OK, but the 'forward' direction gets triggered by the orange button, and moving the stick forward has no effect. I've tried a few different pin numbers at random without any success. In trying to debug this I am struggling to understand how the pins in the code below relate to the pin numbers in the hardware guide. http://papilio.cc/index.php?n=Papilio.ClassicComputingShield#joystick void loop(){ GD.putstr(40, 10, digitalRead(5) ? "-" : "F"); // maps to my orange button GD.putstr(40, 20, digitalRead(6) ? "-" : "D"); // works GD.putstr(35, 15, digitalRead(7) ? "-" : "L"); // works GD.putstr(45, 15, digitalRead(8) ? "-" : "R"); // works //GD.putstr(17, 24, digitalRead(2) ? "-" : "S"); // always on (if I un-comment this) Any insights appreciated, Rupert Quote Link to comment Share on other sites More sharing options...
Felix Posted September 12, 2015 Report Share Posted September 12, 2015 I havent used gameduino yet and i know you marked some as // works, but try it to see what happens. GD.putstr(40, 10, digitalRead(13) ? "-" : "F"); GD.putstr(40, 20, digitalRead(11) ? "-" : "D"); GD.putstr(35, 15, digitalRead(9) ? "-" : "L"); GD.putstr(45, 15, digitalRead(8) ? "-" : "R"); GD.putstr(17, 24, digitalRead(12) ? "-" : "S"); // fire button? // atari joystick schematics http://www.epanorama.net/documents/joystick/atari_stick.gif Quote Link to comment Share on other sites More sharing options...
rupello Posted September 13, 2015 Author Report Share Posted September 13, 2015 @Felix, thanks for the suggestion, but it didn't work - I will check my stick against the schematic you send though Quote Link to comment Share on other sites More sharing options...
Felix Posted September 13, 2015 Report Share Posted September 13, 2015 Let us know what you find Been meaning to mess with it myself. Quote Link to comment Share on other sites More sharing options...
rupello Posted September 13, 2015 Author Report Share Posted September 13, 2015 OK - I looked at the circuit diagram and see that only four of the joystick switches are mapped - no FWD for some reason - and the joytest example has the pins mixed-up which confused me further https://dl.dropboxusercontent.com/u/138749/perma/joystick-pins.png You should definitely check-out the gameduino though as it is awesome. I came down this rabbit-hole trying to get the frog to move properly in the frogger tutorial so I should be able to fix that now! Quote Link to comment Share on other sites More sharing options...
rupello Posted September 13, 2015 Author Report Share Posted September 13, 2015 OK - here is a patched version of the frogger tutorial for those that are interested: 1) change #include for gameduino2) fix deprecated type3) re=map joystick pins (need to use the 'fire' button to jump forward)4) add #include for gameduino circuit https://github.com/rupello/frogger-papilio-duo-gameduino/commit/cbb2314be7f2e4703d28c58e927d9f54349115cb Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.