| Reply | « Previous Thread | Next Thread » |
|
Hi there,
I've made a small application that'll make use of the accelerometer in a mobile with PyS60 installed. You'll need the Python shell installed to be able to run it (I have not made it into a .sis file.) Here it is: http://projects.mezane.org/verlet.py What you should see is a box that'll move in whatever direction that the phone is tilted. So if you tilt it right, it'll slide to the right of the screen, and the velocity will vary depending on the amount of tilt. In addition to this, it also applies forces from the acceleration of your phone. So if you hold your phone upright so that the box falls to the bottom of the screen, then move your phone quickly upwards and stop abruptly, the box will fly upwards as you'd expect. This has only been tested on an N95 8GB and since this is the first Python script I've attempted I'd appreciate input on my code. I'm positively surprised at the simplicity of developing applications using Python and also at the responsiveness of the accelerometer! Regards, Andreas |
|
Quote:
(ps. the "e32.ao_sleep()" can be somewhat dangerous to use - the application will panic should the user exit during the sleep call, please see the API document for more information) |
|
Quote:
Thanks for your input! Doesn't the PyS60 v1.4.1 sensor module enable accelerator access equally on all mobiles with an accelerator? Is there any way for me to make my script compatible with more mobiles? I've changed my code to use e32.Ao_timer() and to call cancel() on the timer when the application is exiting. I hope this solves the "panic" problem? I also added friction when an atom touches the edge of the screen. |
|
Quote:
Yes N95 8GB support AccSensor and RotSensor from "sensor" extension without problem I have tested this on on a N95 8GB V10.0.021 29-09-07 ![]() N95 with the new firmware released 20.0.015 has been reported working also ! ![]() BR Cyke64 pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/ |
|
Quote:
Congratulation for your cool example ![]() "sensor" module don't work with all mobile containing an accelerator ![]() Reported mobile 3rd edition containing an accelerator are N93i,N95,N95 8GB,N82 and 5500. If they support "sensor" (implementing sensor API from 5500) depend on firmware. You could refer to this panel in the wiki (sensor = "sensor" module support) But you could also for N95 < 20.0.015 use module "aXYZ" and NRC plugin (search "aXYZ" for more info) BR Cyke64 pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/ |
|
pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/ |
|
Yep, I've always liked coding Verlet particle physics and mass-spring physics because they're easy to implement and fun to play with.
Here are a few other tests I made with my JavaScript Verlet engine (they were mainly made for Mozilla Firefox, I'm afraid): http://projects.mezane.org/physics-e...html/test.html http://projects.mezane.org/physics-e...ml/funnay.html (Use arrow keys) I was thinking about how to turn Verlet physics + accelerometer into a game. One could make an obstacle course where the player has to rotate their phone to get through it. |
|
Quote:
![]() Yes it's a great idea ! I made a porting of your verlet.py for aXZY module for other N95 with previous firmware. I noted that X and Y data are inverted and sign inversion is not needed in aXYZ ! Cyke64 pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/
Last edited by cyke64 : 2007-11-30 at 14:24.
|
|
I got my new N82 today...
Quote:
|
|
Unfortunately not for me due to the problem described here:
http://discussion.forum.nokia.com/fo...d.php?t=118545 Regards |
| neil.young |
| View Public Profile |
| Find all posts by neil.young |
|
Quote:
|
![]() Does it mean that the shell is signed with all the capabilities? BR Croozeus |
|
Quote:
Location and positioning is working. Simply "import sensor" crashes with permission fault. Hell |
| neil.young |
| View Public Profile |
| Find all posts by neil.young |
|
Quote:
Location and positioning is working. Simply "import sensor" crashes with permission fault. Maybe this doesn't work because Sensor is _not_ an option in Application Capabilities!?!. Seems that the Symbian DevCertificate Request Center has to provide a means to add Sensor-Capabilities? (Just a guess). Doing that they also could rewrite their terrible, completely unreadable CAPTCHA-stuff... Brrr... Took me hours to come over it... Hell |
| neil.young |
| View Public Profile |
| Find all posts by neil.young |
|
Quote:
Happy new year 2008 to every PyS60 forumer ! I have a cool idea for a game with verlet : implementing a similar game to Crayon Physics ![]() Somebody has already ported this game to iPhone : iPhysics ! You can download and try on your PC too : Crayon Physics and Marker World (a clone !) View Crayon Physics on YouTube ! BR Cyke64 pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/
Last edited by cyke64 : 2008-01-02 at 15:56.
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Bluetooth netbeans demo fails on symbian emulator (and in the mobile phone) | backspace | Mobile Java Tools & SDKs | 4 | 2007-06-22 14:45 |
| Using Nokia Demo Projects with Eclipse 3.2.0 | PionsysAtNokia | Mobile Java Tools & SDKs | 5 | 2006-10-10 16:24 |
| Standalone Emulator Demo | desmondling78 | Mobile Java Tools & SDKs | 0 | 2005-02-22 02:02 |
| Small job -> Demo Application ?? | Tim.Myers | Mobile Java General | 2 | 2004-11-11 08:53 |
| where can i find the demo? | yyy_nokia | PC Suite API and PC Connectivity SDK | 1 | 2003-11-15 05:34 |