Archived:Axyz module PySymbian location example
Article Metadata
Tested with
Devices(s): N95
Compatibility
Platform(s): S60 3rd Edition FP1
Platform Security
Capabilities: )
Article
Keywords: Axyz
Created: User:Kandyfloss
(07 Apr 2008)
Last edited: hamishwillee
(07 Feb 2012)
Overview
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.
Preconditions
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()

