Hello guys, I'm engineerkid A couple of days ago I wanted to play some retro games. So I installed them on my Pc. But I could only play with my Pc's keyboard and that did not give the feel of my childhood days. So I decided to build a gamepad for my Pc that can play old as well as new games(Not all). I used a old gaming controller and modified it to create this awesome Gamepad. This is a wired game pad for PC. It can be used to play emulator and PC games. Also the joystick can serve as a mouse for your PC. The Game pad is controlled using an Arduino Pro Micro.
Old Retro game controller
You can use a retro game controller like the one I used. If you have access to a 3d printer, you can print your own casing(This option will give you room for adding more buttons).
Arduino Pro Micro
https://in.utsource.net/itm/p/9221678.html For this project you need to use an Arduino Pro Micro or Arduino Leonardo mini. In short you need a micro controller with HID (Human Interface Device) capability. Arduino Pro micro has an ATmega 32U4 micro controller.
This is a normal slider switch which I used for emergency purpose. The problem with working with mouse and keyboard library is that if you fail to upload a correct code you could loose the control of your keyboard or mouse. So it is very essential to have a switch which could help you to regain the control of your PC mouse/keyboard.
I would recommend to first check all the connections and working on a breadboard.
Key mapping :
The layout of my actual button placement is also shown above (2nd image) to give you a clear idea which button is positioned where, what label it is programmed with and what character it sends to the computer.
Code for the Arduino
Now download the code and install the mouse.h and keyboard.h libraries. Upload the code to your Arduino.
First cut the PCB according to the size of the Game pad and align the push buttons and the joystick module. You can avoid this hectic task of soldering by ordering a PCB. UTSource.net provide quality PCB's at affordable rates.
Then paint the game pad with the color of your choice.
Now solder the push buttons and joystick on general purpose pcb.
Then fix the limit switches in their positions with the help of some super glue.
Solder the remaining components and do a final test.