{"id":16623690,"url":"https://github.com/jandelgado/usb-spinner","last_synced_at":"2025-04-23T23:42:38.737Z","repository":{"id":87338014,"uuid":"323761347","full_name":"jandelgado/usb-spinner","owner":"jandelgado","description":"An USB spinner game controller using an Arduino Micro Pro.","archived":false,"fork":false,"pushed_at":"2020-12-23T00:20:48.000Z","size":2334,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T04:41:27.218Z","etag":null,"topics":["arcade","arduino","game-controller","paddle","spinner","usb"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jandelgado.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2020-12-23T00:14:20.000Z","updated_at":"2025-01-01T17:45:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"62702777-c572-44e6-a439-08441d1b60e0","html_url":"https://github.com/jandelgado/usb-spinner","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jandelgado%2Fusb-spinner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jandelgado%2Fusb-spinner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jandelgado%2Fusb-spinner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jandelgado%2Fusb-spinner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jandelgado","download_url":"https://codeload.github.com/jandelgado/usb-spinner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250535060,"owners_count":21446503,"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":["arcade","arduino","game-controller","paddle","spinner","usb"],"created_at":"2024-10-12T03:24:37.941Z","updated_at":"2025-04-23T23:42:38.377Z","avatar_url":"https://github.com/jandelgado.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Let's build an USB spinner controller\n\n![build](https://github.com/jandelgado/usb-spinner/workflows/build/badge.svg)\n\nA spinner is a game controller with a wheel and buttons, where the wheel is\ntypically used to control the movement of the player object. In contrast to the\nsimilar [paddle\ncontroller](https://en.wikipedia.org/wiki/Paddle_%28game_controller%29), a\nspinner uses typically a [rotary\nencoder](https://en.wikipedia.org/wiki/Rotary_encoder), reporting relative\npositions, instead of a potentiometer, which delivers absolute values.\n\n\n\u003cimg align=\"center\" src=\".images/spinner.jpg\" width=400\u003e\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [Parts](#parts)\n* [Build and Run](#build-and-run)\n    * [Circuit](#circuit)\n    * [The case](#the-case)\n    * [Firmware](#firmware)\n        * [Dependencies](#dependencies)\n    * [Run it](#run-it)\n* [Unbricking an Arduino Pro Micro](#unbricking-an-arduino-pro-micro)\n* [See also](#see-also)\n* [Todo](#todo)\n* [Author and License](#author-and-license)\n\n\u003c!-- vim-markdown-toc --\u003e\n\nThis spinner controller uses an Arduino Pro Micro and announces itself as an\nUSB mouse when connected to a host. No additional drivers are needed, runs on\nLinux, Mac and Windows. The Arduino Pro Micro was chosen because of his ability\nto act as an USB device out of the box.\n\n## Parts\n\n* Rotary encoder LPD3806 600BM\n* 2 SANWA OBS-30 buttons\n* Arduino Pro Micro operating at 5V\n* USB cable\n* 3D-printed case and parts\n* screws for the encoder (M3x15) and the case\n\n## Build and Run\n\n### Circuit\n\nThe circuit is very simple. Encoder and buttons are directly connected to the\nArduino Pro Micro. I did not use additional capacitors on the encoder, since\nthese cause problems on fast movements.\n\n\u003cimg src=\".images/circuit.png\"\u003e\n\n### The case\n\nThe case is [3D-printed](https://github.com/jandelgado/geeetech-i3-a-pro). I\nused this model https://www.thingiverse.com/thing:3273180 from Thingiverse.\n\n\u003cimg src=\".images/case_unfinished.jpg\" width=300\u003e\n\nTo attach the rotary encoder to the case, I printed [another part](case/) (had\nno time to modify the original model): \u003cimg style=\"float:left;\nmargin-right:10px\" src=\"case/Paddle Mount Rotary Encoder v2.png\"\nheight=200\u003e\u003cimg src=\".images/encoder_mount.jpg\" height=200\u003e\n\nFinally, the knob of this https://www.thingiverse.com/thing:1667604 model \nis used.\n\n\u003cimg src=\".images/knob.jpg\" width=200\u003e\n\nThis is after everything is connected and wired up:\n\n\u003cimg src=\".images/wiring.jpg\" width=300\u003e\n\n### Firmware\n\nThis project uses [platformio](https://platformio.org) (but should also compile with\nthe Arduino IDE without problems). The firmware is located in the\n[firmware](firmware/) directory. \n\n* To build the firmware run `make` \n* To flash the firmware run `make upload`\n\n#### Dependencies\n\n* https://github.com/arduino-libraries/Mouse\n* https://github.com/madleech/Button\n* https://github.com/PaulStoffregen/Encoder\n\n### Run it\n\nAfter the pro micro is flashed, it should announce itself as an USB mouse\ndevice (Linux example):\n\n```\n[ 7007.507696] input: SparkFun SparkFun Pro Micro as\n/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/0003:1B4F:9206.000C/input/input34\n[ 7007.508133] hid-generic 0003:1B4F:9206.000C: input,hidraw2: USB HID v1.01\nMouse [SparkFun SparkFun Pro Micro] on usb-0000:00:14.0-2/input2\n```\n\nMoving the paddle should move the mouse cursor horizontally on the screen. The\nbuttons are mapped to the left and right mouse button.\n\n## Unbricking an Arduino Pro Micro\n\nIn case you bricked your Pro Micro, follow these instructions to re-animate\nthe boot loader again:  https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/all#ts-revive\n\n## See also\n\n* https://www.arduino.cc/reference/en/language/functions/usb/mouse/\n* https://www.instructables.com/Atari-Like-USB-Paddle-Using-Arduino-Leonardo/\n* https://www.thingiverse.com/thing:1667604\n* https://www.thingiverse.com/thing:3745009\n\n## Todo\n\n[ ] make configurable at runtime (e.g. Sensitivity, orientation)\n\n## Author and License\n\n(C) Copyright 2020 by Jan Delgado. License: MIT.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjandelgado%2Fusb-spinner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjandelgado%2Fusb-spinner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjandelgado%2Fusb-spinner/lists"}