Rotate is one of the applications that runs on the Openmoko Phones. It’s a quick and simple C program that reads a packet from the accelerometer once per second, and rotates the screen to a new orientation if the orientation has changed.

New Rotate by Rui Seabra is a rewrite of this application, aiming to make it, of course, better.


* uses a second thread for reading the accellerometer packets
* drops Fabian’s changes (not that they weren’t good, just not needed any more)
* adds flags (look at display_help() or ./rotate -h)
* drops packets with 0 value coordinates (I got bogus packets like that so I decided to drop them, if you feel you get good packets with 0 value, you can use ‘-0’ as an argument to take them in account).
* top -d 1 -p PID shows 0.0% CPU usage (of omnewrotate) even during rotation
* seems to waste a little too much memory (some stuff could be done with one number and bitwise operations instead of several numbers, I wonder how much that will improve and if it’s worth the effort…)
* only output outside of debug mode are real errors