Namespaces
Variants
Actions
(Difference between revisions)

Archived:How to get accelerometer data of N900 using Qt

Jump to: navigation, search
Line 3: Line 3:
 
===Introduction===
 
===Introduction===
  
In this post, I will demonstrate how to develope a Qt Application that will to get the information of accelerometer sensor at N900 device.
+
In this post, I will demonstrate how to develop a Qt Application that will to get the information of accelerometer sensor at N900 device.
 +
 
 +
An accelerometer is a device that measures proper acceleration, the acceleration experienced relative to freefall.Single- and multi-axis models are available to detect magnitude and direction of the acceleration as a vector quantity, and can be used to sense orientation, vibration and shock. Micromachined accelerometers are increasingly present in portable electronic devices like mobile phones and video game controllers, to detect the orientation of the device or provide for game input.
 +
 
 +
===Accelerometer Data at N900===
 +
 
 +
The accelerometer data is '''sysfs''' file information.Sysfs is a virtual file system provided by Linux 2.6. Sysfs exports information about devices and drivers from the kernel device model to userspace, and is also used for configuration.
 +
 
 +
The three coordinates of accelerometer sensor is in a text file provided on one line and separated by white space. This file is at path below:
 +
 
 +
'''/sys/class/i2c-adapter/i2c-3/3-001d/coord'''
 +
 
 +
The values are in mG (milli G). 1000 = 1 G. The '''g-force''' experienced by an object is its acceleration relative to free-fall like described above.
 +
 
 +
At N900 device , the values are connected to the position showed below.
  
 
[[File:postN900Accelerometer.png|700px|900px]]
 
[[File:postN900Accelerometer.png|700px|900px]]
 +
 +
===The Code===

Revision as of 06:19, 24 March 2010


Introduction

In this post, I will demonstrate how to develop a Qt Application that will to get the information of accelerometer sensor at N900 device.

An accelerometer is a device that measures proper acceleration, the acceleration experienced relative to freefall.Single- and multi-axis models are available to detect magnitude and direction of the acceleration as a vector quantity, and can be used to sense orientation, vibration and shock. Micromachined accelerometers are increasingly present in portable electronic devices like mobile phones and video game controllers, to detect the orientation of the device or provide for game input.

Accelerometer Data at N900

The accelerometer data is sysfs file information.Sysfs is a virtual file system provided by Linux 2.6. Sysfs exports information about devices and drivers from the kernel device model to userspace, and is also used for configuration.

The three coordinates of accelerometer sensor is in a text file provided on one line and separated by white space. This file is at path below:

/sys/class/i2c-adapter/i2c-3/3-001d/coord

The values are in mG (milli G). 1000 = 1 G. The g-force experienced by an object is its acceleration relative to free-fall like described above.

At N900 device , the values are connected to the position showed below.

PostN900Accelerometer.png

The Code

1204 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved