maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Simple Rifle App using Accelerometer (https://talk.maemo.org/showthread.php?t=46083)

metalx1000 2010-02-28 02:13

Simple Rifle App using Accelerometer
 
Written in Python using PyGame, this script plays a Rifle sound every time you point the phone like a Gun.
Here is a Video of it.

Here is the Code.


Very Simple Script I hope will help other just beginning to write code for the phone using the accelerometer.

clasificado 2010-02-28 02:53

Re: Simple Rifle App using Accelerometer
 
i will play with it a bit :D

firstknight 2010-02-28 10:17

Re: Simple Rifle App using Accelerometer
 
am new to this. will u b kind enuf to give me full steps on how to get it working? thx

F2thaK 2010-02-28 10:48

Re: Simple Rifle App using Accelerometer
 
haha this is kewl

anapospastos 2010-02-28 10:53

Re: Simple Rifle App using Accelerometer
 
I run python n900mm.py in xterm and it says to me "import sys, pygame, time ImportError: No module named pygame". I have to install this to get it work?

anapospastos 2010-02-28 11:17

Re: Simple Rifle App using Accelerometer
 
Quote:

Originally Posted by anapospastos (Post 549709)
I run python n900mm.py in xterm and it says to me "import sys, pygame, time ImportError: No module named pygame". I have to install this to get it work?

I tried to install it but it says incompatible package. Any ideas?

Edit: It run just good. I had to run apt-get python-pygame.

metalx1000 2010-02-28 18:52

Re: Simple Rifle App using Accelerometer
 
Quote:

Originally Posted by anapospastos (Post 549709)
I run python n900mm.py in xterm and it says to me "import sys, pygame, time ImportError: No module named pygame". I have to install this to get it work?

Humm, I thought PyGame came installed on the N900. But, I guess I was wrong.

metalx1000 2010-02-28 20:05

Re: Simple Rifle App using Accelerometer
 
Quote:

Originally Posted by firstknight (Post 549693)
am new to this. will u b kind enuf to give me full steps on how to get it working? thx

Sure, it's simple.
After downloading and unzipping the file,
Navigate, in your terminal (xterm), to the folder called "N900mm".
Once in there type the following:
Code:

./n900mm.py

That is it.
If you need more help, let me know.


All times are GMT. The time now is 16:07.

vBulletin® Version 3.8.8