Sensor Sample

To see more JOM Software applications, click here.

 Download:
sensor_sample.py 2.0

Tutorial 2.0

Version History

Version 2.00, release date 2008-08-17

Version 1.10, release date 2008-05-01.

  • Code clean-up with pylint
  • Not tested with any sensor phone

Version 1.00, release date 2008-04-21.

  • Tested with N93 (pyS60 1.4.1), E61i (pyS60 1.4.2) and N95 (pyS60 1.4.2) (thanx Töte for testing!)

Code Samples

  • How to to use Sensor API
  • How to write common code for sensor and non-sensor devices
  • How to write common code for different sensor combinations
  • How to use built-in OrientationFilter
  • How to get and handle raw sensor data
  • How to use device in non-horizontal position

Sensor Sample

When I participated "Forum Nokia Code Camp: S60 Sensor APIs", my biggest problem was lack of python sample code. Official documentation was very short and didn't tell at all what do with given technical details, Sensor API implementation (sensor.py) was even less helpful. Finally I found the API test code. It wasn't much.

I just barely managed to make a functional script during the afternoon and that code didn't work in non-sensor devices. Had to use quite a lot of time to experiment and figure out how to do things.

This script contains everything I know about using Sensor API with PyS60. I hope it helps you to get started a bit faster!

Disclaimer: I haven't used any sensor device with Tap sensor after Code Camp. Not sure, if that code still works.