Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Arduino Micro Spinner Controller with Buttons  (Read 3250 times)

0 Members and 1 Guest are viewing this topic.

jmtw000

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:January 22, 2019, 09:53:02 am
  • I want to build my own arcade controls!
Arduino Micro Spinner Controller with Buttons
« on: December 31, 2018, 06:11:56 pm »
I really wanted a spinner controller to play old ball and paddle games like Arkanoid and Super Breakout, as well as Tempest in MAME. But the commercial ones were a little out of my price range. So, I decided to roll my own with the help of the Arduino joystick and mouse libraries. I created a handheld spinner controller with six buttons. It's built from an Arduino Micro (or clone), a 2-phase rotary encoder, and some momentary switch buttons. I wanted a handheld controller, but you should be able to use it in cabinet builds just as easily.

https://github.com/jmtw000/Arcade-Spinner

ark_ader

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5645
  • Last login:March 02, 2019, 07:35:34 pm
  • I glow in the dark.
Re: Arduino Micro Spinner Controller with Buttons
« Reply #1 on: January 01, 2019, 02:25:14 am »
A ball or optical mouse hack is cheaper and works just the same and no soldering.  ;D
If I had only one wish, it would be for three more wishes.

baritonomarchetto

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:Yesterday at 01:08:27 pm
Re: Arduino Micro Spinner Controller with Buttons
« Reply #2 on: January 01, 2019, 04:35:39 am »
With a mouse hack you have not 6 buttons. You also have no control on sensitivity. Arduino is the best solution for this kind of projects because of the cheap board (you can get a micro clone for 3-5 bucks fro cina) and degrees of freedom you have by creating your own "firmware".

jmtw000

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:January 22, 2019, 09:53:02 am
  • I want to build my own arcade controls!
Re: Arduino Micro Spinner Controller with Buttons
« Reply #3 on: January 01, 2019, 09:53:25 am »
A ball or optical mouse hack is cheaper and works just the same and no soldering.  ;D

Yeah, I thought about doing that at first but I wanted more buttons and didn't want to sacrifice a nice 6 button mouse for it. Using an Arduino Micro clone and a cheap encoder only cost me around $30 US to build this. And soldering is easy once you get the hang of it. You can add as many buttons to this controller as you like as well. I settled on 6 because it seemed that covered most ball and paddle games. For example in Ghox, I have the first two buttons mapped to player 1 buttons 1 and 2. The next two are for moving up and down and the final 2 are for coin and start. Using the encoder and Arduino also gives you much finer control. The encoder I used is a 600 pulse per rotation one. However, if you track all state changes, which I do, you can read 2400 positions per rotation. Now, that's too many as a USB HID mouse can only be polled at 1ms intervals max. Meaning, the most you can move the pointer (assuming you're moving it by 1 pixel at a time) each second is 1000 pixels. So, I only move the mouse pointer once for every 2 state transitions in either direction. This gives me 1200 positions per rotation of the encoder knob, which is close enough to the max polling rate for my purposes. I also track the position of the encoder as it relates to the mouse pointer. Meaning, you will not lose any state changes no matter how fast you turn the knob. If you turn the knob from 12 O'clock to 6 O'clock and back as fast as you can as many times as you want, the mouse pointer will always end up in the same positions. I don't have one to test on, but my suspicion is that a mouse hack spinner can't manage that. Even if the hacked mouse is being polled at 1ms intervals (which it probably isn't) you are going to miss movement as nothing is tracking it to make sure the pointer always ends up in the same position corresponding to the knob location. It's still possible to miss movement if you turn the knob fast enough to exceed the 1ms polling rate. But it's much less likely to miss movement than your standard mouse. I'm not knocking the mouse spinners hacks, they are an easy and cheap solution. But using a rotary encoder and microcontroller is clearly probably better :cheers:
« Last Edit: January 07, 2019, 04:39:53 pm by jmtw000 »