A spinner is a game controller with a wheel and buttons, where the wheel is typically used to control the movement of the player object. In contrast to the similar paddle controller, a spinner uses typically a rotary encoder, reporting relative positions, instead of a potentiometer, which delivers absolute values.
This spinner controller uses an Arduino Pro Micro and announces itself as an USB mouse when connected to a host. No additional drivers are needed, runs on Linux, Mac and Windows. The Arduino Pro Micro was chosen because of his ability to act as an USB device out of the box.
- Rotary encoder LPD3806 600BM
- 2 SANWA OBS-30 buttons
- Arduino Pro Micro operating at 5V
- USB cable
- 3D-printed case and parts
- screws for the encoder (M3x15) and the case
The circuit is very simple. Encoder and buttons are directly connected to the Arduino Pro Micro. I did not use additional capacitors on the encoder, since these cause problems on fast movements.
The case is 3D-printed. I used this model https://www.thingiverse.com/thing:3273180 from Thingiverse.
To attach the rotary encoder to the case, I printed another part (had
no time to modify the original model):
Finally, the knob of this https://www.thingiverse.com/thing:1667604 model is used.
This is after everything is connected and wired up:
This project uses platformio (but should also compile with the Arduino IDE without problems). The firmware is located in the firmware directory.
- To build the firmware run
make
- To flash the firmware run
make upload
- https://github.com/arduino-libraries/Mouse
- https://github.com/madleech/Button
- https://github.com/PaulStoffregen/Encoder
After the pro micro is flashed, it should announce itself as an USB mouse device (Linux example):
[ 7007.507696] input: SparkFun SparkFun Pro Micro as
/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/0003:1B4F:9206.000C/input/input34
[ 7007.508133] hid-generic 0003:1B4F:9206.000C: input,hidraw2: USB HID v1.01
Mouse [SparkFun SparkFun Pro Micro] on usb-0000:00:14.0-2/input2
Moving the paddle should move the mouse cursor horizontally on the screen. The buttons are mapped to the left and right mouse button.
In case you bricked your Pro Micro, follow these instructions to re-animate the boot loader again: https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/all#ts-revive
- https://www.arduino.cc/reference/en/language/functions/usb/mouse/
- https://www.instructables.com/Atari-Like-USB-Paddle-Using-Arduino-Leonardo/
- https://www.thingiverse.com/thing:1667604
- https://www.thingiverse.com/thing:3745009
[ ] make configurable at runtime (e.g. Sensitivity, orientation)
(C) Copyright 2020 by Jan Delgado. License: MIT.