accelball: Python + N95 accelerometer demo
So, today, I built a small application to demonstrate the use of the accelerometer built into the Nokia N95. I decided to convert a simple example: the ‘ball.py’ example that ships with 홀덤사이트 Nokia’s distribution of Python for Series 60 (SourceForge).
The ball.py example uses the arrow keys to move a ball around the screen. Instead, I wanted to tilt the screen to do it.
The result came out reasonably well: I even used the webcam on the eeepc to put together a little video:
The code is available from my Symbian page, which has received so few changes that it doesn’t actually even mention my 6600 that I got years ago, and have since upgraded from.
In my searches, I wasn’t able to find a lot of source code for pure-Python scripting using the accelerometer, so hopefully if anyone is looking for demos of accelerometer usage, they can take this as an example in Python.
Love to hear any feedback if anyone else gives it a shot…
February 3rd, 2008 at 10:48 am
Well at least I was able to watch the YouTube video on my iPhone. Seriously though, that is impressive.
February 4th, 2008 at 3:31 pm
Very cool. You could make one of those labyrinth games where you tilt the maze to move a ball past holes and navigate a maze.
February 22nd, 2008 at 5:16 pm
Yeah – great stuff.
I’m kinda jealous (in a good way) of people who come up with some of those things.
🙂
March 28th, 2008 at 6:01 am
Very nicely done, congrats 😉
April 2nd, 2008 at 2:54 pm
How does one get this nifty app running ??
June 7th, 2008 at 6:56 pm
Do all N95s have the accelerometer sensor? When I do a sensor.sensors()[‘AccSensor’] I get a KeyError, but when I do a sensor.sensors()[‘RotSensor’] I get the category and id. Shouldn’t just doing sensor.sensors() return all available sensors?
Thanks in advance and thanks for the great example.
October 21st, 2009 at 11:04 pm
Same question (different year) as Raj Godbole – I get a KeyError for AccSensor but can do the RotSensor, no prob. Any pointers? Thanks!