Leonardo Gamepad by codebender

This sketch is missing a short description
This is an example code for using the Arduino Leonardo and the Sparkfun Joystick Shield to create your own gamepad.

Embed This Sketch

Use the following HTML code to embed the sketch code above in your blog or website.

<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/sketch:8320" frameborder="0"></iframe>

Embed The Serial Monitor

You can also embed the Serial Monitor section! Just use this HTML code.

<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/serialmonitor" frameborder="0"></iframe>

  • 2019-09-02 Kris Munro

    Thanks for the details. Very easy to implement, and works great.
    I'm also interested in having key presses function in the same way as how you've done the joystick; holding the button sustains the button press rather than one instance of that key stroke.
    I'm also hoping to have a toggle button to allow me to switch between the digital style joystick (as in your example) and an analogue one where degrees from origin influence movement speed.
    Despite your project not being perfect for my needs, you've detailed a lot of the code in a way that allowed me to overcome much of the initial learning curve that beginners often struggle with. A bit more research should lead me in the right direction. Thanks!