First of all, I apologize for my laziness in updating X2 with new code example. I have actually written quite a number of interesting examples, some of which have even been shown back in March, during my talk at Bossa Conference 10, though I did not find the time to clean up and polish them. Although I’d face new challenges in my upcoming adventure, I am quite confident I will reach the designated rate of new X2 example fortnightly.
Now let’s focus on the newest example: a minor modification to the previous accelerometer code on Nokia N900 . There has been confusion with my statement there: put this function is a separate thread. This is the alternative to a non-blocking D-Bus code. The main goal of course is not to be able to get faster acceleration values per second, it is only to prevent your code from being blocked by the synchronous D-Bus call.
Rather than just updating the code with the threaded version, I also added some high-school Newtonian physics. Instead of boring sliders, you’ll get a ball which moves based on the acceleration , i.e. it follows the gravity if you keep your N900 straight.
Here is the obligatory video. Or watch directly on YouTube.
The code can be found in the X2 repository under the sensor/bouncingball subdirectory.
In the next installment, we will integrate a third-party real physics engine and make the example more alive!
 Another approach is to use Qt Mobility. However, QTMOBILITY-381 (which was spawn from QTMOBILITY-326) has not been solved yet (as of today).
 The overall math is not too scientifically correct, but hey, I always need to leave out something, for your homework 😛