In the previous post we created the hardware for an arduino gamepad. Now it’s time to connect it to a simple rough game just to see that it works.
First of all we need a library that can success the serial communication for trading data between our application and arduino. I used “Tserial” library you can download it from here (both .h and .cpp files). I create this very-simple-arcanoid on Borland C++ 6 framework.
It’s time to make some noise, ok musicians friends who have an Arduino board and some time to spend, I’ll show you how to build a very simple piano using a piezo for playing sound.
Our piano is gonna have the basec 8 notes : ‘c’ , ‘d’, ‘e’, ‘f’, ‘g’, ‘a’, ‘b’, ‘C’ so that’s what we need to create this :
– Arduino board
– Piezo (for sound output)
– 8 buttons (one for every note)
– 8 Resistors (for the buttons)
– 10 Cables
The circuit connectivity :
All gamers have a dream to create their own game and make money with that (or just playing it), in this post I’ll show you a very simple arcanoid-type game but playing it your you own gamepad.
Ok I’ll not create a game but a gamepad, it still cool! The gamepad I’ll make it is based on arduino board and ATMEGA328 microprocessor. In this part I will show you the hardware side and in the next part I’ll connect this to the “game”.
First of all what do we need :
– An Arduino board
– 3 buttons (for left – right – hit)
– A piezo (for sound when you hit)
– 9 Cables (to connect the components)
– 3 Resistors ( for the button’s potential)
– And on vibrator , I take it out from a ps2 gamepad, and I used “durex vibrating ring” before, yes I did. ( It vibrates when losing)
So the circuit connection is the following :
(Click image for full)
The 5 Degree Of Freedom accelometer
You can get it from :
The accelometer is a electronic device that measures acceleration forces. These forces could be static, like gravity or dynamic when something cause them, changing the direction of forces e.t.c.
So the 5DOF is an electronic circuit / sensor that has some outputs which gives us the acceleration values on each X-Y-Z coordinates.
In this post I’ll receive these values from the accelometer circuit via Arduino (http://www.arduino.cc) and I’ll show them graphically via Proccessing Script Language (http://processing.org/ ).