How does autorotation work on the iPhone (in terms of hardware, not software) I have always wondered how the orientation/autorotation hardware works inside an iPhone/iPad/iPod Touch.

Originally I thought it was the accelerometer but I don't think it is as an accelerometer can only measure movement and the iPhone knows it's current orientation without any movement.

I have assumed until now that there is a little tilt switch inside the phone as well as the accelerometer and that this is used, but really I have no idea and Google isn't helping much! ;)

Anyone know how it works?
It´s called a gyroscope. Have a look at  this article on iFixit, it explains it (within an iPhone 4) quite well.