| Reply | « Previous Thread | Next Thread » |
|
Hello there,
I'm really committed to create some fancy application with the accelerometer sensor, it has great potential, but I faced problems. The possibilities: J2ME: I wanted to use this, but unfortunately no JSR-256 support in Nokia devices. PyS60: Seems very friendly, but "import sensor" fails with ("Module not found _sensor") SiS: I do not want it this way, unless otherwise it's not possible. (Although I didn't find any sensor example for E66 either) I googled all my yesterday about this topic, but most of the forum topics were 1 year old, and only were about N95 and 5500. But as you can see in the title, I have E66, and I don't even know if there's any chance I could handle that sensor. The resources on the net are really limited to N95 unfortunately... I've tried N95 examples on my phone, but all without success. So my final question is: Is it possible to overcome that PyS60 "Module not found _sensor" error in E66, and is PyS60 meant to handle the E66's accel sensor at all? If it doesn't even meant to, how could I do this in SiS? For reference: I installed "PythonForS60_1_4_4_3rdEd.sis" and "PythonScriptShell_1_4_4_3rdEd.SIS" from sourceforge without any other modification (signing, etc..) Thank you in advance, Attila Incze |
|
Wiki Contributor of the Month (May). Winner of the May Contest on Wiki. |
| cabezonxdg |
| View Public Profile |
| Find all posts by cabezonxdg |
|
Thank you, although I've already found that thread, and if I wanted to start an API partnering request: "The page you have requested is made viewable for Forum Nokia PRO member companies only."
Why sensor API isn't public? I'm afraid I'll never get my hands on this, as I'm just a "simple person", not "Forum Nokia PRO member companies" ... |
|
http://wiki.forum.nokia.com/index.ph...nsor_Framework
i found this.And end of the page example works fine in e66. |
| programciyim |
| View Public Profile |
| Find all posts by programciyim |
|
Hi!
I want to use acceleromter data from my N85 in a python programm, but get the same error as atimb when trying to start a little sample code. I installed 'PythonForS60_1_4_5_3rdEd' and singed version of 'PythonScriptShell_1_4_5_3rdEd_unsigned_testrange' Do I need to install anything else on the phone to get connection to the sensor??? Here is my code: Code:
import sensor
import e32
import time
class DemoApp:
def __init__(self):
self.accelerometer = AccelerometerXYZAxisData(data_filter=LowPassFilter())
self.accelerometer.set_callback(data_callback=self.my_callback)
self.counter = 0
def my_callback(self):
if self.counter % 5 == 0:
print "X:%s, Y:%s, Z:%s" % (self.accelerometer.x,
self.accelerometer.y, self.accelerometer.z)
self.counter = self.counter + 1
def run(self):
self.accelerometer.start_listening()
d = DemoApp()
d.run()
e32.ao_sleep(1)
d.accelerometer.stop_listening()
print "Exiting Accelorometer"
|
| theresa_nick |
| View Public Profile |
| Find all posts by theresa_nick |
|
Please check if this works in your phone:
http://jouni.miettunen.googlepages.com/sensorsample Cheers, --jouni |
|
Hi!
I can start the programm, but nothing happens. I thought this programm only works on FP1 devices, but N85 is FP2. |
| theresa_nick |
| View Public Profile |
| Find all posts by theresa_nick |
|
Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
gaba88
Online
Forum Nokia Champion
|
|
|
Quote:
hello theresa_nick AFAIK if you want to use the sensor module in FP2 device you need PyS60 1.9.2 or later. Sensor Module will not work for FP2 devices in PyS60 1.4.5 Enjoy Pythoning Gaba88 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Quote:
Sommy missed that! E66 is FP1, but N85 is really FP2! FP2 contains the new Sensor Framework, which is supported only by PyS60 1.9.x branch. I'll write myself a note to make an updated sample... PyS60 1.9.3 is pretty stable, so it shouldn't be any problem. http://wiki.forum.nokia.com/index.php/Nokia_Sensor_APIs Cheers, --jouni |
|
Thanks a lot for your support.
I changed to 'Python_1.9.3_3rdEd_unsigned_high' and 'PythonScriptShell_1.9.3_unsigned_high'(which I open signed for my phone), but still get an ImportError that 'No module named _sensor' can be found |
| theresa_nick |
| View Public Profile |
| Find all posts by theresa_nick |
|
Ok, I changed to version 1.9.2 and now it just works
Code:
from sensor import *
import e32
import time
class DemoApp():
def __init__(self):
self.accelerometer = AccelerometerXYZAxisData(data_filter=LowPassFilter())
self.accelerometer.set_callback(data_callback=self.my_callback)
self.counter = 0
def my_callback(self):
# For stream sensor data the callback is hit 35 times per sec(On
# 5800). The device cannot handle resource hungry operations like
# print in the callback function for such high frequencies. A
# workaround is to sample the data as demonstrated below.
if self.counter % 5 == 0:
print "X:%s, Y:%s, Z:%s" % (self.accelerometer.x, self.accelerometer.y, self.accelerometer.z)
self.counter = self.counter + 1
def run(self):
self.accelerometer.start_listening()
if __name__ == '__main__':
d = DemoApp()
d.run()
e32.ao_sleep(1)
d.accelerometer.stop_listening()
print "Exiting Accelorometer"
|
| theresa_nick |
| View Public Profile |
| Find all posts by theresa_nick |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| E66 Accelerometer Question? | ranrinc | General Discussion | 9 | 2009-07-15 18:44 |
| N95 Accelerometer & JSR-256 | AnthonyAndrews | Mobile Java General | 9 | 2009-04-21 23:12 |
| Accelerometer | mikedeklerk | General Symbian C++ | 32 | 2008-04-29 16:10 |
| Finding accelerometer update frequency | phishboh | Python | 1 | 2008-02-19 16:49 |