Complete Arcade Spinner
thingiverse
This is a complete spinner to use with an arcade cabinet, designed for Mame enthusiasts. I developed this project from scratch, as there wasn't a suitable design available. Here's what you'll need: 1. Leonardo Micro ATmega32U4 16MHz 5V (Replace Arduino Mini Stock TE463) - Available on eBay at http://www.ebay.com/itm/322097722501 2. Incremental Optical Encoder with Rotary Encoder, 400 Impulses / REV - Available on eBay at http://www.ebay.com/itm/181881354349 3. 3 m3x10 screws 4. 1 m2x12 screw with nut To create the spinner's components, print the knob and flange using a 3D printer. Insert this code into your Arduino Micro: ``` #include enum PinAssignments { encoderPinA = 2, encoderPinB = 3, clearButton = 8 }; volatile int encoderPos = 0; int lastReportedPos = 1; int encoderMove = 0; boolean A_set = false; boolean B_set = false; void setup() { pinMode(encoderPinA, INPUT); pinMode(encoderPinB, INPUT); pinMode(clearButton, INPUT); digitalWrite(encoderPinA, HIGH); // turn on pullup resistor digitalWrite(encoderPinB, HIGH); // turn on pullup resistor digitalWrite(clearButton, HIGH); // encoder pin on interrupt 0 (pin 2) attachInterrupt(0, doEncoderA, CHANGE); // encoder pin on interrupt 1 (pin 3) attachInterrupt(1, doEncoderB, CHANGE); } void loop() { if (lastReportedPos != encoderPos) { encoderMove = (encoderPos-lastReportedPos); if (digitalRead(clearButton) == LOW) { encoderPos = 0; } if ((encoderMove=-127)) Mouse.move(encoderMove, 0, 0); else if (encoderMove>127) Mouse.move(127, 0, 0); else Mouse.move(-127, 0, 0); lastReportedPos = encoderPos; } delay(10); } // Interrupt on A changing state void doEncoderA() { // Test transition A_set = digitalRead(encoderPinA) == HIGH; // and adjust counter + if A leads B encoderPos += (A_set != B_set) ? +1 : -1; } // Interrupt on B changing state void doEncoderB() { // Test transition B_set = digitalRead(encoderPinB) == HIGH; // and adjust counter + if B follows A encoderPos += (A_set == B_set) ? +1 : -1; } Using this spinner, you can play Arkanoid with a nice arcade experience. Connect the Arduino pins as follows: Pin 2 for A and Pin 3 for B. If you need further assistance, feel free to contact me.
With this file you will be able to print Complete Arcade Spinner with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Complete Arcade Spinner.