{"id":18321752,"url":"https://github.com/webstackdev/button-box","last_synced_at":"2025-07-01T01:32:51.982Z","repository":{"id":117347736,"uuid":"468413352","full_name":"webstackdev/button-box","owner":"webstackdev","description":":checkered_flag: :traffic_light: Code to use an Arduino Uno micro-controller with rotary encoders for DIY virtual sim button boxes. Happy Simming!","archived":false,"fork":false,"pushed_at":"2022-03-10T21:57:32.000Z","size":95,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T14:34:53.103Z","etag":null,"topics":["arduino-uno","buttons","rotary-encoders","simulator"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webstackdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-10T16:00:53.000Z","updated_at":"2024-03-03T22:35:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"6d61d3f2-1920-41b7-92f3-bf72226123d0","html_url":"https://github.com/webstackdev/button-box","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/webstackdev/button-box","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webstackdev%2Fbutton-box","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webstackdev%2Fbutton-box/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webstackdev%2Fbutton-box/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webstackdev%2Fbutton-box/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webstackdev","download_url":"https://codeload.github.com/webstackdev/button-box/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webstackdev%2Fbutton-box/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262879024,"owners_count":23378539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino-uno","buttons","rotary-encoders","simulator"],"created_at":"2024-11-05T18:21:16.372Z","updated_at":"2025-07-01T01:32:51.955Z","avatar_url":"https://github.com/webstackdev.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arduino Rotary Encoder Code for Button Boxes\n\n![Sample button box](https://raw.githubusercontent.com/webstackdev/button-box/main/static/racing-sim-button-box-rotary-encoder.jpg?raw=true)\n\nThis project is to use an [Arduino Uno R3](http://store.arduino.cc/products/arduino-uno-rev3) board to support rotary encoders in DIY button boxes.\nThese boxes are popular in the racing :blue_car:, flight :airplane: :helicopter:, trucking :articulated_lorry:,\nfarming :tractor:, train :station:, and space :rocket: sim communities because you can tailor\nthe box exactly to your needs and commercial variants are pricey. They're usually built using\na stock electronics box (available on Amazon or AliExpress) with a laser-cut graphite carbon top\n(those can be ordered from a variety of suppliers) and custom-printed labels.\n\nIf you're just using buttons and toggle switches, you can build a simpler box using an arcade-\nstyle USB button board (also available on Amazon or AliExpress).\n\nRotary encoders have two outputs: `outputA` and `outputB`. By detecting the phase shift as the\nknob is rotated, you can tell both where the knob is at on the dial and which way it is being\nturned. That's what this project sets up your micro-controller to do. By default it maps `outputA`\nand `outputB` to Arduino pins `6` and `7` respectively.\n\nThe Uno has a total of fourteen I/O pins. If you have more rotary encoders (as in the above image),\nsimply adjust the code accordingly. You can either use an arcade board or add code to handle buttons /\ntoggle switches.\n\nThere are several software packages that allow you to map the controls in your button box to\nwhatever sim game you're interested in. Searching the sim forums on Reddit will give you an idea\nof the strengths and weaknesses of different mappers, and what works with what game.\n\nHappy simming!\n\n## Overview\n\nThis has been tested using Arduino Uno R3 board and Arduino IDE v1.6.\n\n## How to\n\nTo use this code with your Arduino Uno micro-controller:\n\n1. Fetch the official Arduino IDE: \u003chttp://arduino.cc/en/main/software\u003e\n\n2. Untar the file to somewhere suitable e.g. `/home/user/arduino_ide`\n\n3. Install the following dependencies:\n\n   `avr-libc avrdude binutils-avr gcc-avr`\n\nYou can also re-use the binaries shipped with the Arduino IDE. To do so, set your PATH environment variable accordingly.\n\n3. Checkout this repository:\n\n   `git clone git://github.com/webstackdev/button-box.git`\n\n4. Edit the `Makefile` file to suit your environment. There are two variables that you will need to edit:\n\n   - `ARDUINO_HOME`: the path where you untarred the IDE in step number one.\n   - `SERIAL`: the path where your arduino listens on. If you don't know which one, try plugging and unplugging the board and see what pseudofile in `/dev/` is added.\n\n5. Edit `main.cpp` file if are adding rotary encoders, buttons, switches, or changing the input pin mappings.\n\n6. `make` then `make push`.\n\n## Notes\n\nThe Makefile supports three commands:\n\n- `all`: build and link the main binary\n- `push`: push the binary to the board\n- `clean`: remove the intermediary files\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebstackdev%2Fbutton-box","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebstackdev%2Fbutton-box","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebstackdev%2Fbutton-box/lists"}