![]() |
| × | 1 | |||
![]() |
| × | 1 |
Components and supplies
Necessary tools and machines
![]() |
|
Apps and online services
About this project
Augmented reality and virtual gaming has become a recent trend in the gaming industry. The times of using a keyboard/Joystick and a mouse to play a computer game has gone behind. Now every gaming console comes with a virtual controller that helps us to play the game using our body movements and gestures, this way the gaming experience has increased a lot and user feels more involved into the game. On "circuitdigest" page is presented an example that use Arduino Nano and ADXL335 sensor board.
The ADXL335 is a small, thin, low power, complete 3-axis accelerometer with signal conditioned voltage outputs. In this case we will only use one axle (x) which we need to move the bumper left and right. The accelerometer is connected to the Arduino using only 3 wires as shown in the scheme below. It is powered directly from the Arduino USB port.
The software part consists of Arduino and Processing code.The Arduino program is given below in the Code section. There is no critical data that has to be modified. But you might want to consider the following:
Increase the sample size if your Accel still shows random values:
#define Samplesize 13 // filterSample number
In the void setup() function of Processing code is important, as it decides from which port to data from.
port = new Serial(this, Serial.list()[4], 9600); //Reads the 4th PORT at 9600 baudrate
Now since our Processing and Arduino sketch is ready, just upload the below given program to Arduino and connect your Arduino to user PC thorough programming cable and launch the game by running the Processing code file (.pde). That's it! Move your accelerometer and play your Pong game.
Code
Schematics
Comments
Author
Published on
November 23, 2019Members who respect this project
you might like