×
Namespaces

Variants
Actions

Archived:Axyz module PySymbian location example

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.


Article Metadata
Tested with
Devices(s): N95
Compatibility
Platform(s): S60 3rd Edition FP1
Article
Keywords: Axyz
Created: User:Kandyfloss (07 Apr 2008)
Last edited: hamishwillee (31 May 2013)

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 Archived: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()

Related Links

Archived:The aXYZ - a sensor extension for Python

This page was last modified on 31 May 2013, at 04:06.
58 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×