We thought it would be interesting to get accelerometer and gyroscopic data from our phone to our computer in a workable form. This application is a game, but this could be applied to more useful projects.

What it does

The phones are running a python script that constantly gets the acceleration and gyroscopic data and send it to a Flask web server. The game makes requests to a JSON API on the web server to get the data the phones send. The tilt of the phone on the x axis controls the position of the tennis racket and acceleration data is used to make the ball go fast or slow depending on the speed at which you move your phone along the z axis.

How we built it

We used python and Flask to create a web server that handles data input and output. We used an app called pythonista to write python code on our phones and get the accelerometer and gyroscopic data. On the computer, we utilized pygame to create the tennis game.

Challenges we ran into

We had to first interpret the gyroscopic and accelerometer data with very limited documentation.

Accomplishments that we're proud of

We made every image/sprite/screen from scratch using pixel art. We are proud of the fact that we were able to effectively transfer the data from a phone's built in sensors to be utilized in a game.

What we learned

We learned how to integrate mobile, web, and desktop development.

What's next for Phone Controlled Tennis Game

Our method of transferring the accelerometer and gyroscopic data from our phones to the desktop can be used in broader applications such as fitness tracking.

Built With

Share this project: