Giter VIP home page Giter VIP logo

Comments (7)

CrazySpence avatar CrazySpence commented on September 13, 2024

Are you using the 8-way stick from Adafruit or did you buy a more industry common stick? If you are using a more common stick it sounds like you aren't grounded properly or have a stick with NC (normal closed) and have used those, a direction held should keep the pin active if using Adafruits stick or a proper Normal Open stick.

from adafruit-retrogame.

kidscripter avatar kidscripter commented on September 13, 2024

This is the directional button I will be using: http://www.mouser.com/ProductDetail/ALPS/SKQUCAA010/?qs=N5Jky1br14PIN8L1H/2niA==

Right now im just testing with a simple tactile switch but its the same concept as the directional switch.
This is how I have the button wired currently: http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/turing-machine/pins_1110.jpg

Will a tactile switch just not work like that?

from adafruit-retrogame.

PaintYourDragon avatar PaintYourDragon commented on September 13, 2024

I think what you're asking for is auto-repeat; this is an entirely different animal than debouncing.

retrogame issues individual key press & key release events matched to GPIO input. Auto-repeat is purposefully not done as this may interfere with emulated games' own handling of held buttons (which may or may not repeat, and if so, at a rate specifically defined by the game).

from adafruit-retrogame.

PaintYourDragon avatar PaintYourDragon commented on September 13, 2024

Looked into it. The good news is that MAME distinguishes between key PRESS and key REPEAT events (the latter are disregarded; this is a GOOD thing for accurate game emulation). I've updated the retrogame code to issue key repeat events when controls are held, making the gamera menu easier to navigate without affecting game play (and doesn't substantially increase CPU load).

from adafruit-retrogame.

kidscripter avatar kidscripter commented on September 13, 2024

I tried out the new code and the repeat part works great but its backwards for my button, when I press down and let go it keeps scrolling down until I either press and hold the button again or pull the resistor. When I put the resistor back it keeps scrolling.

I dont mean for you to change the code for me haha but thank you very much! Is there something small I can change for my case to make this work right?

from adafruit-retrogame.

PaintYourDragon avatar PaintYourDragon commented on September 13, 2024

Shouldn't need a resistor.
Pin -> button -> GND

from adafruit-retrogame.

kidscripter avatar kidscripter commented on September 13, 2024

Thank you works great!

from adafruit-retrogame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.