Are you a gaming freak? Want to top the high score list? If your answer is yes you are at the right place. Can all this be achieved with you sitting idle and your phone doing all the talking? Yes it can be done and we’ll show you how.
Introduction to Stick Hero: Stick hero is one of the world famous, time eating game with over 10 Million Downloads. To download the App on your smart phone click here. If you are new to the game, have a look at the game play here.
Single Strand Wires, Coins, Relays are used to simulate the touch on the capacitive touch screen of phones and tablets. Arduino is used to control the duration of the touch. Tripod, for holding a phone above the camera (refer fig-1)
Matlab: Used for Image Processing.
Arduino IDE: For programming the Arduino.
IP Cam: It is an android app which enables us to use our smartphones cam as a web cam. This project involves three basic steps,
Detecting the black pillars:
This is done by using Matlab. The image that is captured from the IP Cam is processed and the locations of the black pillars are determined. The distance between the black pillars is calculated and the corresponding data is sent to the Arduino through serial communication. The source code for the above processing can be found here.
Determining the duration of the touch:
Based on the data arrived from Matlab, the duration of the touch is adjusted such that the stick exactly falls on the adjacent pillar. The source code for the arduino can be found here.
For this we have to understand how capacitive touch screens work. The electrodes apply a low voltage to the conductive layer creating a uniform electrostatic field. When a finger hits the screen a tiny electrical charge is transferred to the finger to complete the circuit creating a voltage drop at that point on the screen. The location of this voltage drop is recorded by the controller and this is how a capacitive touch screen works.
We are going to use this concept, except that in the place of a finger, we use the ground pin on the arduino to transfer the charge on the screen. To have more surface area on the display of the screen, we use a coin. Relays are directly connected to the output pin of the Arduino. It is equivalent to a touch if the voltage given is high as there is a path for the current to flow to the ground. It is equivalent to not touching if the voltage given is low.
Run the test_relay code at this link to see if the electronic touch is simulated properly. If you pass the above three tests, you are all set to break the records! :D
Source Code and Schematics: This is an open source project, the code and schematics can be found in the below link: https://github.com/psurya1994/arduino-plays-stick-hero
Subscribe to this blog via RSS.
Adb tool 5