Hey, I want to show an easy way to build a basic game controller with joystick. The Jetpack transmits the data from joystick serially via Bluetooth. You can play any game on your PC with this, you just need to change the required key as shown in the read me file. We did this as part of our kickstarter called Jetpack a wireless programing Bluetooth shield+motor driver shield for Arduino. You can use your own substitutes for this.
Got 750% funded on Kickstarter! We are amazed by this response and so jet pack is now available for preorder on http://www.jetpackshield.com/
- Jetpack (Bluetooth shield)
Step 1: Make the Connections As Shown
Connect the Joystick to Jetpack and mount it on an Arduino as shown in the picture. Connect the power supply.
- [VRx] X-Axis (analogue)
- [VRy] Y-Axis (analogue)
- [SW] Push button (Connects to GND)
Step 2: Upload the Code
You can easily upload your program wirelessy with Jetpack. Refer this instructable (data monitoring) for wireless programing. You will be using the outgoing Com Port when you upload the code.
Alternatively you can upload your program directly to Arduino. The code is given below. Before going to the next step please ensure that all the connections are complete and sensor is sending the data
Step 3: Install Python,Run the Python Script
- Install python version 2.7(recommended) or above, Don't forget to check add to path while installation
- Install pyserial library by entering "python -m pip install pyserial" in cmd.exe (for windows)
- The default keys for joystick are the keyboard arrow keys
- If you need to change the input keys refer the read me file(depends on the game you want to play)
- Run the launch-joystick-mode.bat file
- Find the outgoing Com Port as shown in the picture above and enter when prompted