Editing N900 accelerometer
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
- | The accelerometer detects orientation and movement of the | + | The accelerometer detects orientation and movement of the phone. |
==Hardware== | ==Hardware== | ||
- | The accelerometer in the phone is a [http://www.st.com/ | + | The accelerometer in the phone is a [http://www.st.com//stonline/products/literature/ds/12726/lis302dl.pdf LIS302DL]. |
It is connected through [[N900 Hardware Bus I2C|the I2C bus]]. | It is connected through [[N900 Hardware Bus I2C|the I2C bus]]. | ||
Line 13: | Line 13: | ||
** Click and double click recognition | ** Click and double click recognition | ||
** Zero G detection | ** Zero G detection | ||
- | |||
The click and double click functionality are not implemented in the current software. | The click and double click functionality are not implemented in the current software. | ||
Line 31: | Line 30: | ||
===Bugs=== | ===Bugs=== | ||
- | Sometimes the LIS302 in N900 gets massive offset on one or more axes, due to unknown reason (possibly I2C errors). Symptoms: Dialer autorotation fails or gets weird. Even rebooting seems not to help to fix this, but removing battery for some seconds resets the chip. | + | Sometimes the LIS302 in N900 gets massive offset on one or more axes, due to unknown reason (possibly I2C errors). Symptoms: Dialer autorotation fails or gets weird. Even rebooting seems not to help to fix this, but removing battery for some seconds resets the chip. |
==Software== | ==Software== | ||
Line 47: | Line 46: | ||
Thomas Thurman ([http://twitter.com/marnanel marnanel]) has put together a simple demo of an application using accelerometers using the D-Bus interface. You can find sources and .deb up at http://people.collabora.co.uk/~tthurman/sandcastle/ | Thomas Thurman ([http://twitter.com/marnanel marnanel]) has put together a simple demo of an application using accelerometers using the D-Bus interface. You can find sources and .deb up at http://people.collabora.co.uk/~tthurman/sandcastle/ | ||
- | |||
- | |||
=== sysfs === | === sysfs === | ||
Line 56: | Line 53: | ||
/sys/class/i2c-adapter/i2c-3/3-001d/coord | /sys/class/i2c-adapter/i2c-3/3-001d/coord | ||
- | When reading that file you get 3 values X, Y and Z (provided on one line, separated by white space). Values are in mG (milli G). 1000 | + | When reading that file you get 3 values X, Y and Z (provided on one line, separated by white space). Values are in mG (milli G). 1000 = 1 G |
{| class="wikitable" | {| class="wikitable" | ||
- | |||
|- | |- | ||
! Position | ! Position | ||
Line 132: | Line 128: | ||
</source> | </source> | ||
x,y,z are the raw accelerometer measurements values, and the first three variables give text information about the device orientation. In particular, the first one informs about the landscape/portrait state. | x,y,z are the raw accelerometer measurements values, and the first three variables give text information about the device orientation. In particular, the first one informs about the landscape/portrait state. | ||
- | |||
- | |||
=== Smoothed C interface === | === Smoothed C interface === | ||
Line 175: | Line 169: | ||
} | } | ||
</source> | </source> | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
[[Category:N900 Hardware]] | [[Category:N900 Hardware]] | ||
[[Category:Development]] | [[Category:Development]] |
Learn more about Contributing to the wiki.