2019-08-02 13:16:50 +02:00
|
|
|
* What is this?
|
|
|
|
This is a simple recipe for turning your Arduino into a usable
|
|
|
|
joystick/gamepad.
|
|
|
|
|
|
|
|
I am using [[https://robotdyn.com/joystick-shield-for-arduino.html][RobotDyn Joystick shield]] which makes the whole process
|
|
|
|
trivial.
|
|
|
|
|
|
|
|
* Compiling
|
|
|
|
Install the dependencies:
|
2019-08-05 20:30:38 +02:00
|
|
|
|
2019-08-02 13:16:50 +02:00
|
|
|
- [[https://github.com/sudar/Arduino-Makefile][Arduino Makefile]] (available as arduino-mk in Ubuntu/Debiab)
|
|
|
|
- [[https://github.com/MHeironimus/ArduinoJoystickLibrary][Arduino Joystick Library]]
|
|
|
|
|
2019-08-05 20:30:38 +02:00
|
|
|
Tweak ~joystick.ino~ to suit your needs. In particular, enable or
|
|
|
|
disable using the Y axis as additional buttons.
|
|
|
|
|
2019-08-02 13:16:50 +02:00
|
|
|
Then just run ~make~ and ~make upload~ to flash the board.
|
|
|
|
|
2019-08-05 20:30:38 +02:00
|
|
|
** Y axis as buttons
|
|
|
|
Using the Y axis on the joystick as additional buttons is useful for
|
|
|
|
playing e.g. SuperTuxKart, where you only need the joystick for
|
|
|
|
steering.
|
|
|
|
|
2019-08-02 13:16:50 +02:00
|
|
|
* Wiring
|
|
|
|
There is nothing to wire -- just pop the shield onto your board and
|
|
|
|
plug it in!
|
2019-08-05 20:30:38 +02:00
|
|
|
|
|
|
|
* Debugging
|
|
|
|
You can use the ~jstest~ tool on Linux.
|