| ID | ... | Creation date | 7 April 2008 |
| Platform | S60 3rd Edition FP1 | Tested on devices | N95 |
| Category | Python | Subcategory | Sensor |
| Keywords (APIs, classes, methods, functions): Axyz |
The accelerometer can be used to check the orientation of the mobile device using the axyz module of Cyke64 in python. Here is a test script for axyz which is automatically installed when installing the axyz module on the device.
The device should have accelerometer sensor. Check Nokia Sensor APIs
# Import the extension
import e32
import axyz
# Define some service function - must take 3 parameters (8 bit int's)
def printout(x,y,z):
print "x: %i y: %i z: %i"%(x,y,z)
# Data acquisition callbacks will start as soon as a valid Python function is registered
axyz.connect(printout)
#
#
#... Data acquisition callbacks will commence and ended after 15 secs
#
#
e32.ao_sleep(15)
# Unregister to stop data acquisition callbacks.
axyz.disconnect()
No related wiki articles found