Introduction
Smartphones sure have transformed our gaming experience; a number of games that we used to play on our PC are now available on Smartphones. But, nothing can ever beat the fun of playing games on the PC using a gaming console. Period. So, we’re bringing you a new, revolutionary game controller: the Dabble app, our indigenously developed project-making mobile application. Among its various amazing features, Dabble has the Gamepad module; it transforms your Smartphone into a game controller of three types:
- The gaming console or the digital mode
- The Joystick or the analog mode
- The accelerometer mode
The best part? It’s free! All you need is your dear pal evive, the HC-05 Bluetooth module, your PC with all your favorite games in it, and Dabble, which you can download for free from here; you’re all set to relive the best days of your life!
So, what are you waiting for? Install. Connect. Play!
Connection
Connect the HC-05 Bluetooth module to evive as shown in the figure and connect evive to your Laptop or PC using the USB A-B cable.
You must be thinking that the next step will be making a controller to play games with.
Surprise! We won’t be ‘making’ another controller as you have a Smartphone. Just download Dabble, connect, and your controller is ready!
Now, all you’re left with to do is upload the code to evive so that you can use your Smartphone as a controller, not just a normal one but a wireless controller.
Code
We won’t be using just Arduino IDE; we will even use Processing.
The reason why we are using it is that we need to establish communication between Arduino and your laptop.
Here, the communication takes place in two steps.
When you click the buttons on the Gamepad, the corresponding value is sent to Arduino via evive.
Arduino then sends the data to Processing, which in turn performs the action assigned to the corresponding value.
Eg., when you press ‘UP’ key. Arduino sends ‘1.’ to Processing. Processing then performs the action that 1 corresponds too.
Before uploading the code, make sure that the value of COM Port in both Arduino and Processing is the same.
The following Arduino Code should be uploaded to evive.
You can download the Processing from the code section below.
Logic
The Gamepad has three modes:
You can use all the three modes.
Connect your phone to the Bluetooth Module of evive.
Once connected you are ready to play the game with.
- The first mode is the normal digital mode where you can control the game by pressing or in your case touching the corresponding button.
- The Second mode is the Joystick mode. This is similar to controlling the game using a real-life joystick. Not just games, you can scroll also UP or DOWN on any page using this mode.
- Last but not least, the accelerometer mode. In this case, you do not have to press a button or move the joystick. All you need to do is tilt your phone. When you tilt the phone in any particular direction, your object in the game will follow the instruction and move in that particular direction.
Conclusion
With this, you’re all set to bring back the gaming experience of the past and that too without spending even a single penny. Enjoy!