OpenMoko: NEO QtExtended Accelerometer

March 7, 2009 Matteo Bertozzi | Filed Under OpenMoko | No Comments

Neo Accelerometer Device 3QtExtended doesn’t have an accelerometer class, so I’ve decided to Write my on class with a simple Example. A Spot that moves around X and Y Axis using Accelerometer Information.

The Second NEO Freerunner Sensor, in contrast to the first sensor  is turned 45 degrees around the Z axis. See the attached image to get a clue about its orientation.

The information from both of the accelerometers is exported through two different input event based file mappings. These device nodes can be found at /dev/input/event2 and /dev/input/event3.

The QAccelerometer Class emit an Event called accelerate(qreal x, qreal y, qreal z) that gives you X, Y, Z axis values.

Each acceleration event relays the current acceleration readings along the three axes of the device. Therefore, a value of 1.0 represents a load of about +1g along a given axis while a value of -1.0 represents -1g.

You can find More information about OpenMoko Accelerometer here “Accelerometer Data Retrieval” and “Accelerometer Technical Fundamentals“.

Keep in Mind this Simple Table of X, Y,  Z axis and Phone State:
( 0,  0,  1) = Front
( 0,  0, -1) = Back
( 1,  0,  0) = Vertical (Short Side), Right
(-1,  0,  0) = Vertical (Short Side), Left
( 0, -1,  0) = Vertical (Long  Side), Front
( 0,  1,  0) = Vertical (Long  Side), Back

The Source Code is Available Here: NEO QAccelerometer Test Source Code.

No Comments yet »

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>