Object rotation device direction

Hi,

How can I can calculate object rotation depending device direction? I know I can read gravity but i don’t know how to use it, to calculate object rotation.

What I need is, i have and arrow and want always point to up when you put you device infront you.

Thanks.

David [import]uid: 44539 topic_id: 8042 reply_id: 308042[/import]