Code Monkey home page Code Monkey logo

ddruino's Introduction

DDRuino

A simple dance pad controller implementation for Arduino devices

(c)2021 j "fluffy" shagam, [email protected]

About

I was pretty dissatisfied with the code quality of all of the Arduino-based dance pad (DDR/Stepmania/etc.) controller sketches I could find, so I decided to write my own using more-modern C++ with an easier means of configuring things.

This only needs Arduino's default keyboard library, and is intended to let you customize the mapping on a per-pin basis. It requires an Arduino with built-in USB HID support (such as a Leonardo, a LilyPad USB, etc.) and a dance pad that uses contact sensors. I use it with an ATmega 32U4 that I bought off Aliexpress and installed into an L-Tek. See this tutorial for a pretty good explanation of how to perform the L-Tek mod yourself.

Usage

Modify the mapping array to include all of your active pins and their respective buttons. The mapping provided is just how my pad happens to be wired up; yours will probably vary.

If you have two pads in a doubles set, you'll want to set the pads' arrow buttons to be different keys (for example, wasd for the left pad and ijkl for the right pad).

If you're not sure how your pins are connected, you can uncomment the #define DEBUG line and then run the sketch with the serial monitor enabled, and it'll give you a continuous display of which pins are currently active. Just remember to disable debug mode (i.e. comment the #define back out) before you start using the pad for actual gameplay; leaving it enabled will vastly lower your input sampling rate.

Debouncing is on a per-switch basis so it shouldn't be necessary to make it shorter than 20ms (which allows a peak of 25 steps per second on a single switch) but it's probably safe to reduce it further. The minimum safe debounce time will depend a lot on your individual pad. This particular (simple) debounce implementation will never add latency to an initial step.

ddruino's People

Contributors

fluffy-critter avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

communityus-llc

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.