Go Down

Topic: Using accelerometer to control computer games? (Read 3477 times) previous topic - next topic


How do I use the accelerometer in Arduino Esplora to control computer games as if the Arduino Esplora is a tablet? I controlled a game on a tablet by tilting the tablet.


You can check the game I ported to the Esplora which uses the accelerometer.  Writeup is at http://21stdigitalhome.blogspot.com/2013/01/first-self-contained-arduino-esplora.html
and the code at https://github.com/TheKitty/EsploraApps

The game saves all the values: x, y, and z but I think it actually only processes the x values - if you shake one way it moves the ball in the direction of the shake along thepositive or negative x axis.  It uses the Esplora.readAccelerometer function, documentation at http://arduino.cc/en/Reference/EsploraReadAccelerometer. I found that the movement was opposite of what the Esplora library thought was positive so I multiplied by negative one to change it.

If you've done accelerometer controlled gaming/programming before, it is straightforward.  I hope this helps.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131